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