Wednesday, February 16, 2011

How to grab the triggers from a SQL Server database

Have you ever needed to get the script that created a trigger on a table in a SQL Server database?

Try this:
select b.text
from sysobjects a
join syscomments b on a.id=b.id
where xtype='TR'
Hope that helps.

No comments:

Post a Comment