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