Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Server level trigger at Database level... Expand / Collapse
Author
Message
Posted Tuesday, May 18, 2010 2:16 PM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: 2 days ago @ 12:32 PM
Points: 55, Visits: 376
My boss found a table in live data that we can't account for on who created it or what it's for. Barring a security issue & whatever along those lines I'm creating a trigger to fire off if someone alters/drops/creates a table in a database.

As you probably already know I can do this at a database level with no problems. Is there a way to put a trigger at the server level to trip the ALTER_TABLE/DROP_TABLE/CREATE_TABLE when anything is done at the database level? Or will I be stuck putting this trigger on each database?


Thanks!


I know, I know...my subject line is back-a$$-wards. Should be "Database trigger at server level"


======================================================
John
SQL Server 200x Newb and proud of it!
======================================================
Post #923901
Posted Tuesday, May 18, 2010 2:21 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, February 11, 2013 8:27 AM
Points: 1,735, Visits: 1,947
My guess is you should have them on each of the databases in that Server

These should help you..

http://www.sql-server-performance.com/articles/audit/ddl_triggers_p1.aspx

http://www.developer.com/db/article.php/3552096/Using-DDL-Triggers-to-Manage-SQL-Server-2005.htm



Bru Medishetty

Blog -- LearnSQLWithBru

Join on Facebook Page Facebook.com\LearnSQLWithBru

Twitter -- BruMedishetty
Post #923905
Posted Tuesday, May 18, 2010 2:23 PM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: 2 days ago @ 12:32 PM
Points: 55, Visits: 376
Bru Medishetty (5/18/2010)
These should help you..

http://www.sql-server-performance.com/articles/audit/ddl_triggers_p1.aspx


Coincidentally I've been using that one all day working on my issue.



Found this one as well. Still reading it.


======================================================
John
SQL Server 200x Newb and proud of it!
======================================================
Post #923909
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse