Archive - March 2015

1
Find Text In a Stored Procedure On SQL Server

Find Text In a Stored Procedure On SQL Server

Time and time again I find the need to search all stored procedures for a table name or text in SQL server. Below is snippets of code that will do this task for you: SELECT OBJECT_NAME(object_id), OBJECT_DEFINITION(object_id) FROM sys.procedures WHERE OBJECT_DEFINITION(object_id) LIKE ‘%TEXT TO SEARCH FOR%’ SELECT DISTINCT o.name, o.xtype FROM syscomments c INNER JOIN[…]

Read More