Michael Kniskern
Michael Kniskern

Reputation: 25270

Find in Files command in SQL Server Management Studio

Is there way to use the "Find in Files" command for searching all of the stored procedures and views for a particular database in SQL Server 2005 Management Studio?

Edit

I want to search all of the stored procedures in database X for string Y.

Upvotes: 1

Views: 3120

Answers (1)

Kevin Doyon
Kevin Doyon

Reputation: 3578

You can't.

You can however use a query, for exemple:

SELECT ROUTINE_SCHEMA, ROUTINE_NAME, ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_TYPE = 'PROCEDURE'
AND ROUTINE_DEFINITION LIKE '%searchstring%'

This will however not work for CLR or encrypted stored procedures.

Upvotes: 4

Related Questions