Tuesday, 25 August 2009

No drop trigger - SQL

USE [JobLog]
GO
/****** Object: DdlTrigger [trig_nodrop] Script Date: 07/08/2009 16:59:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [trig_nodrop]
ON DATABASE
FOR
drop_table, alter_table
AS
PRINT
'...you cannot do that, ha ha ha...'
ROLLBACK
;

GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
ENABLE TRIGGER [trig_nodrop] ON DATABASE

No comments: