Prvni verze
This commit is contained in:
25
_sql/trg__hdc_PZ_PuvodniVC_D.sql
Normal file
25
_sql/trg__hdc_PZ_PuvodniVC_D.sql
Normal file
@ -0,0 +1,25 @@
|
||||
-- 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
|
||||
Reference in New Issue
Block a user