December 29, 2007 at 7:35 pm
Comments posted to this topic are about the item Find occurence of any value in database!
December 31, 2007 at 7:57 am
just some notes:
Occurrences might be misleading since it's a count of syscomments records associated with the object that contain the search string rather than a count of instances of that search string in those entries.
Also, you might want to add to the type list the following
WHEN SO.xtype = 'TF' THEN 'Table Function - early binding' -- table defined in header
WHEN SO.xtype = 'IF' THEN 'Table Function - late binding' -- table, undefined
WHEN SO.xtype = 'FN' THEN 'Scalar Function'
ELSE '*** ' + SO.xtype + ' ***'
Thanks
December 31, 2007 at 8:56 am
The script fails to post in my SQL 2005 studio with the follow errors (fyi CREATE is on the first line):
Msg 102, Level 15, State 1, Procedure spUtil_Occur, Line 3
Incorrect syntax near '?'.
Msg 137, Level 15, State 2, Procedure spUtil_Occur, Line 39
Must declare the scalar variable "@SearchString".
Looks OK to me. Am I missing something?
Thanks for the post!
December 31, 2007 at 8:57 am
Oops, I meant fails to COMPILE.
December 31, 2007 at 9:44 am
When I attempted to insert my version of the stored procedure in Sql Server 2005, it came up with the same error messages detailed above. I retyped the third line (@SearchString SQL_VARIANT) with a tab as the first character and it complied properly. Evidently, there are embedded invisible characters in the text when copied directly from the article.
December 31, 2007 at 11:20 am
Quite right! Thank you.
September 11, 2008 at 10:09 am
September 11, 2008 at 10:27 am
I'm here! My address should be reddyss@charter.net
What's up?
February 17, 2009 at 11:45 pm
Does this stored proc really give the occurence of a value in the database or the occurence of a attribute/field name in the database ?
I have a value and I need to check all the tables in the database where this value is present. Is there a way to get all the tables and column names in which the value is present?
February 18, 2009 at 6:03 am
Yes, it finds the value in the data by exact match or LIKE, depending on the parameter sent in. E-mail me directly at reddyss@charter.net for the code.
Pat
May 11, 2016 at 7:16 am
Thanks for the script.
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply