Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Trigger Help

Author  Topic 

jscot
Posting Yak Master

106 Posts

Posted - 2010-02-13 : 17:11:01
I have one question,
I want to right a trigger that every time any one or I trying to drop a table from adventure work that stop.

ms65g
Constraint Violating Yak Guru

497 Posts

Posted - 2010-02-13 : 17:33:54
[code]
USE your_database_name
GO

CREATE TRIGGER safety
ON DATABASE
FOR DROP_TABLE, ALTER_TABLE
AS
PRINT 'You must disable Trigger "safety" to drop or alter tables!'
ROLLBACK ;

[/code]
Go to Top of Page

jscot
Posting Yak Master

106 Posts

Posted - 2010-02-14 : 00:48:57
Thanks for your help!
Go to Top of Page
   

- Advertisement -