SharpDeveloper
Search Trigger Text SQL Server 2005
If you want to search triggers for text in SQL Server 2005, here is how you can do it. You would execute this in the case that you are looking for a trigger that updates a certain table, but you cannot find it, and you do not want to go through all the tables one by one, here is what you can execute:
SELECT OBJECT_NAME(id) FROM syscomments WHERE [text] LIKE '%your_search_here%' AND OBJECTPROPERTY(id, 'IsTrigger') = 1 GROUP BY OBJECT_NAME(id)
And here is how you can search SQL server stored procedures (external link).
Related Reading:
Other Interesting Posts
3 Responses to Search Trigger Text SQL Server 2005
Leave a Reply Cancel reply
-
Articles
- January 2011
- April 2010
- March 2010
- February 2010
- January 2010
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- February 2009
- December 2008
- November 2008
- October 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
-
Meta








personlaly I prefer:
SELECT text
FROM syscomments
WHERE [text] LIKE ‘%trigger%’
– if you want a trg attached to specific table
AND [text] LIKE ‘%On Tablename%’
or use following statemant. it will produce same results, just fewer lines in T-SQL
SELECT * FROM sys.triggers WHERE name LIKE ‘%your_search_here%’
Would be more helpful if it list the tables too. Thanks