SQL Server Admin
T-SQL Articles

February 16, 2009

Find Which Tables Have Triggers in SQL Server 2005/ 2008




If you want to quickly list down the tables having triggers in your database, here's how to do so:


USE [YourDB]


SELECT


OBJECT_NAME(parent_id) AS TableName,


name AS TriggerName,


create_date AS CreationDate,


modify_date AS ModifyDate


FROM sys.triggers




I ran the query on the PUBS database and got the following results:


TableName TriggerName      CreationDate              ModifyDate


employee  employee_insupd 2009-01-23 14:16:35.680 2009-01-23 14:16:35.680



Did you like this post?
kick it on DotNetKicks.com
subscribe via rss subscribe via e-mail
print this post follow me on twitter


About The Author

Suprotim Agarwal, ASP.NET Architecture MVP works as an Architect Consultant and provides consultancy on how to design and develop Web applications.

Suprotim is also the founder and primary contributor to DevCurry, DotNetCurry and SQLServerCurry. He has also written an EBook 51 Recipes using jQuery with ASP.NET Controls.

Follow him on twitter @suprotimagarwal

 
  Feedback:

comments

2 Responses to "Find Which Tables Have Triggers in SQL Server 2005/ 2008"
  1. rajat said...
    September 17, 2010 3:41 AM

    thanks for giving great answer

  2. Anonymous said...
    May 24, 2012 8:30 AM

    Thanks

 

Copyright © 2009-2012 All Rights Reserved for SQLServerCurry.com by Suprotim Agarwal | Terms and Conditions