Skip to main content

You are here

Search the entire Database for an Object containing a string

This query searches the entire database for objects containing the indicated string. This, among other uses, is good for locating a piece of code no mather where they reside in the database.

SELECT DISTINCT OBJECT_NAME(ID)
FROM SYS.SYSCOMMENTS
WHERE TEXT LIKE '%[TEXT TO SEARCH FOR]%'

Tags: 

Category: 

Language: 

0
No votes yet

Add new comment

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.

Disclaimer

Note that the codes and ideas expressed on this site are the authors personal views. The content of this website are the personal notes based on the learning experience of the author. The author will not be responsible for any error or damages resulting from you using the content of this website.

Premium Drupal Themes by Adaptivethemes