Click to See Complete Forum and Search --> : Search db for all triggers and list SQL


tcarnahan
08-30-2008, 04:14 PM
Hi!

I am not new to SQL but I am new to using T-SQL and the system tables.

I inherited a SS2K database that is fairly extensive. I need to examine the SQL coding of all triggers in all instances of the datbase. I have Enterprise Manager, but it would be a lengthy process to open all tables of all instances to examine the SQL coding.

I am able to query system tables but I don't know the schema well enough to do find the information I need.

QUESTION: can someone point me to a T-SQL query that will find all triggers in the SS group and list the following?

- Instance name
- Table name
- Trigger name
- SQL code that makes up the trigger

Any help you can provide would be greatly appreciated!

-- Tom

Hack
09-03-2008, 02:22 PM
I found this (http://www.sqlmag.com/Article/ArticleID/94862/sql_server_94862.html) for listing them.

I found nothing for displaying the code within them however.

tcarnahan
09-04-2008, 12:08 AM
Thanks for the code ... I appreciate it!