Search text in stored procedure in SQL Server Search text in stored procedure in SQL Server sql-server sql-server

Search text in stored procedure in SQL Server


Escape the square brackets:

...WHERE m.definition Like '%\[ABD\]%' ESCAPE '\'

Then the square brackets will be treated as a string literals not as wild cards.


Try this request:

Query

SELECT nameFROM   sys.proceduresWHERE  Object_definition(object_id) LIKE '%strHell%'


Have you tried using some of the third party tools to do the search? There are several available out there that are free and that saved me a ton of time in the past.

Below are two SSMS Addins I used with good success.

ApexSQL Search – Searches both schema and data in databases and has additional features such as dependency tracking and more…

SSMS Tools pack – Has same search functionality as previous one and several other cool features. Not free for SQL Server 2012 but still very affordable.

I know this answer is not 100% related to the questions (which was more specific) but hopefully others will find this useful.