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 Administration
 how to see DML trigger content?

Author  Topic 

allan8964
Posting Yak Master

249 Posts

Posted - 2012-03-07 : 16:57:18
Hi there,

If I know there is a DML trigger by using

select * from sys.triggers

and I know the trigger name how can I see the script of that trigger?

robvolk
Most Valuable Yak

15732 Posts

Posted - 2012-03-07 : 17:00:37
select name, OBJECT_DEFINITION(object_id) from sys.triggers
Go to Top of Page

allan8964
Posting Yak Master

249 Posts

Posted - 2012-03-07 : 17:34:15
OK, but the format is horrible. I copy that out to a notepad, still no lines feedback ... any better way?
Thanks for help.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2012-03-07 : 17:40:06
Use Results to Text rather than Grid.

You can also find the trigger in the Object Explorer in Management Studio and script it from there.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-03-07 : 17:48:29
or you can go to your version control

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -