-- dbo.ET_TabVyroba_OperaceStartStop_D
CREATE TRIGGER dbo.ET_TabVyroba_OperaceStartStop_D ON dbo._TabVyroba_OperaceStartStop
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._TabVyroba_OperaceStartStop)
   BEGIN
    SELECT @id=MAX(ID) FROM dbo._TabVyroba_OperaceStartStop
    DBCC CHECKIDENT(_TabVyroba_OperaceStartStop, RESEED, @id)
   END
  ELSE
   TRUNCATE TABLE dbo._TabVyroba_OperaceStartStop

END
