August 3, 2005 at 10:28 am
Hello,
I have been trying to find a way to search for a certain string within all stored procedures in a database. After a seach on this site I found quite a few. Thanks, this helped.
My question. No matter which method I try I get proper results for "[Database].[dbo]" but no results for "[Database].[dbo]." I am wondering why this might be as I am actually looking for "[Database].[dbo].[tblSpecificTable]".
Thank you in advance for your help,
Chuck
August 3, 2005 at 11:28 am
What did you try?
Does this work?
Select object_name(id) from dbo.SysComments where text like '%[Database].[dbo].[tblSpecificTable]%'
August 3, 2005 at 12:37 pm
BOL: LIKE
...
Symbol Meaning
LIKE '[[]' [
LIKE ']' ]
...
Check collation on your server, may be is case-sensitive and try this:
select object_name(id) from dbo.syscomments where text like '%[[]Database].[[]dbo].[[]tblSpecificTable]%'
August 4, 2005 at 3:10 am
Thank you for the help everyone.
The '[[]' works great. It just didn't occur to me to look at the '[' and ']' as they were inside the quote marks.
Thank you again.
Chuck
August 4, 2005 at 6:32 am
Brackets are a special character... look up quotename('some string') and see what the function returns .
August 4, 2005 at 10:10 am
Just wanted to mention that you might want to try the Free SQL Server Add-on Tool called SQL Digger (http://sqldigger.bdsweb.be/). This tool is great and easy to use. You can also search through multiple databases at once.
----------------------------------------------------------01010011010100010100110000100000010100110110010101110010011101100110010101110010001000000101001001101111011000110110101101110011
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply