How to search for specific text in the whole DB

[highlighter]

I found this bit of code somewhere on the internet, I think I used it to find all stored procedures with the database name hardcoded into the SP.

One thought on “How to search for specific text in the whole DB

  1. The code above works with SQL Server 2005. However, for SQL Server 2000, you will need to use the code below:SELECT O.name AS TableName, C.name AS ColumnName, T.name AS Type, C.length AS MaxLengthFROM sysobjects OINNER JOIN smoyslucns C ON O.id = C.idINNER JOIN systypes T ON C.xtype = T.xtypeWHERE O.type = U’ORDER BY O.name, C.colid

Leave a Reply

Your email address will not be published.