-- dbo.ET__hdc_ph_Log_D
CREATE TRIGGER dbo.ET__hdc_ph_Log_D ON dbo._hdc_ph_Log
WITH EXECUTE AS CALLER
FOR DELETE
AS
BEGIN
 SET NOCOUNT ON

-- ! trigger neupravujte, bude stejne pregenerovan pri startu pluginu PluginHDCRTN !

 DECLARE
  @id INT
  


-- cisteni seedu
 IF EXISTS(SELECT 1 FROM dbo._hdc_ph_Log)
   BEGIN
    SELECT @id=MAX(ID) FROM dbo._hdc_ph_Log
    DBCC CHECKIDENT(_hdc_ph_Log, RESEED, @id)
   END
  ELSE
   TRUNCATE TABLE dbo._hdc_ph_Log

END
