2 ago 2010

SQL server 2005 Search Trigger

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)

No hay comentarios.: