SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Simplest way to search any string in db objects


Simplest way to search any string in db objects

Author
Message
ksatpute123
ksatpute123
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1426 Visits: 383
Comments posted to this topic are about the item Simplest way to search any string in db objects
Rossana A. Hnatyshyn
Rossana A. Hnatyshyn
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 17
Very useful.
Can you make it where you can search accross databases in current connection?

Thanks!
dbajunior
dbajunior
SSC Veteran
SSC Veteran (223 reputation)SSC Veteran (223 reputation)SSC Veteran (223 reputation)SSC Veteran (223 reputation)SSC Veteran (223 reputation)SSC Veteran (223 reputation)SSC Veteran (223 reputation)SSC Veteran (223 reputation)

Group: General Forum Members
Points: 223 Visits: 1603
Description: This procedure will allow you to find any string in any DB Object with its name or part of its name.
It will also allow you to find the column name belongs to which tables, TV functions and Views.
Not picking up any table objects for some reason. Does check procs, views, triggers and functions.
ksatpute123
ksatpute123
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1426 Visits: 383
Rossana A. Hnatyshyn (8/8/2013)
Very useful.
Can you make it where you can search accross databases in current connection?

Thanks!


Didn't actually get your question, could you please elaborate?

Usually what I do is create a short cut to call this SP. After that just highlight the string you want to search and hit the short cut key.

One of the greatest advantage of this approach is that we can find out dependencies for objects where dynamic queries are involved. Just provide the search string and it will be searched across all programmable objects across your database.

Also, if you run this SP in master database you can use it across any database in your server.
ksatpute123
ksatpute123
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1426 Visits: 383
dbajunior (8/8/2013)
Description: This procedure will allow you to find any string in any DB Object with its name or part of its name.
It will also allow you to find the column name belongs to which tables, TV functions and Views.
Not picking up any table objects for some reason. Does check procs, views, triggers and functions.



Sorry for adding this line It will also allow you to find the column name belongs to which tables, TV functions and Views.

I removed this part of code because there were performance issues. Will add it to the SP once I optimize it. Thanks for pointing out the mistake, feedback is always welcome.
Iwas Bornready
Iwas Bornready
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14264 Visits: 885
Thanks for the script.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search