-- dbo.ET__hdc_PZ_PuvodniVC_D
CREATE TRIGGER dbo.ET__hdc_PZ_PuvodniVC_D ON dbo._hdc_PZ_PuvodniVC
WITH EXECUTE AS CALLER
FOR DELETE
AS
BEGIN
 SET NOCOUNT ON
 
 DECLARE
  @id INT
  
 
 
 
 
-- cisteni
 IF EXISTS (SELECT 1 FROM dbo._hdc_PZ_PuvodniVC)
   BEGIN
    SELECT @id=MAX(ID) FROM dbo._hdc_PZ_PuvodniVC
    DBCC CHECKIDENT (_hdc_PZ_PuvodniVC, RESEED, @id)
   END
  ELSE
   TRUNCATE TABLE dbo._hdc_PZ_PuvodniVC  
 
END
