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
 General SQL Server Forums
 New to SQL Server Programming
 DROP TABLE

Author  Topic 

WoodHouse
Posting Yak Master

211 Posts

Posted - 2010-04-23 : 14:56:02
I need to ensure that tables are not dropped from our database
What should i do in following things..

a. create DDL trigger contains COMMIT
b. create DML trigger contains COMMIT
c. create DDL trigger contains ROLLBACK
d. create DML trigger contains ROLLBACK

Help me out this question.

Thanks
Wood.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-04-23 : 15:01:03
You need a DDL trigger that rolls the transaction back. DML triggers are for data modifications.

Your instructor is looking for the answer of C.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

WoodHouse
Posting Yak Master

211 Posts

Posted - 2010-04-23 : 15:02:49
HI Tkizer

Thanks a Lot
Go to Top of Page

ms65g
Constraint Violating Yak Guru

497 Posts

Posted - 2010-04-23 : 15:09:58
You can use this trigger:

CREATE TRIGGER drop_table
ON DATABASE
FOR DROP_TABLE
AS ROLLBACK;
Go to Top of Page
   

- Advertisement -