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


Find text in sql modules


Find text in sql modules

Author
Message
Peter Shilovich
Peter Shilovich
SSChasing Mays
SSChasing Mays (654 reputation)SSChasing Mays (654 reputation)SSChasing Mays (654 reputation)SSChasing Mays (654 reputation)SSChasing Mays (654 reputation)SSChasing Mays (654 reputation)SSChasing Mays (654 reputation)SSChasing Mays (654 reputation)

Group: General Forum Members
Points: 654 Visits: 203
Comments posted to this topic are about the item Find text in sql modules
tamirgerber
tamirgerber
Valued Member
Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)

Group: General Forum Members
Points: 69 Visits: 18
One could use sp_msForEachDB builtin stored procedure. No cursor, no loop, and less chance to get into security issues.
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (975K reputation)SSC Guru (975K reputation)SSC Guru (975K reputation)SSC Guru (975K reputation)SSC Guru (975K reputation)SSC Guru (975K reputation)SSC Guru (975K reputation)SSC Guru (975K reputation)

Group: General Forum Members
Points: 975148 Visits: 49307
tamirgerber - Tuesday, February 19, 2019 6:51 PM
One could use sp_msForEachDB builtin stored procedure. No cursor, no loop, and less chance to get into security issues.


Not quite right. If you look at the actual code sp_msForEachDB and the procedure that calls, its a cursor/loop on steroids. ;-)

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

When you put the right degree of spin on it, the number 318 is also a glyph that describes the nature of a DBAs job. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
tamirgerber
tamirgerber
Valued Member
Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)Valued Member (69 reputation)

Group: General Forum Members
Points: 69 Visits: 18
Jeff Moden - Tuesday, February 19, 2019 9:58 PM
tamirgerber - Tuesday, February 19, 2019 6:51 PM
One could use sp_msForEachDB builtin stored procedure. No cursor, no loop, and less chance to get into security issues.


Not quite right. If you look at the actual code sp_msForEachDB and the procedure that calls, its a cursor/loop on steroids. ;-)

I am sorry for not being clear enough. My idea was that call of sp_msForEachDB eliminates a need to use cursor and loop explicitly. Less custom code - less headache :-)

Peter Shilovich
Peter Shilovich
SSChasing Mays
SSChasing Mays (654 reputation)SSChasing Mays (654 reputation)SSChasing Mays (654 reputation)SSChasing Mays (654 reputation)SSChasing Mays (654 reputation)SSChasing Mays (654 reputation)SSChasing Mays (654 reputation)SSChasing Mays (654 reputation)

Group: General Forum Members
Points: 654 Visits: 203
tamirgerber - Wednesday, February 20, 2019 2:05 AM
Jeff Moden - Tuesday, February 19, 2019 9:58 PM
tamirgerber - Tuesday, February 19, 2019 6:51 PM
One could use sp_msForEachDB builtin stored procedure. No cursor, no loop, and less chance to get into security issues.


Not quite right. If you look at the actual code sp_msForEachDB and the procedure that calls, its a cursor/loop on steroids. ;-)

I am sorry for not being clear enough. My idea was that call of sp_msForEachDB eliminates a need to use cursor and loop explicitly. Less custom code - less headache :-)
Thanks for the feedback Smile
I prefer not to use sp_msForEachDB here for two reasons. Firstly, becase of it is not documented. And secondly, this proc is intended to search for a text in user's DB.

Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (975K reputation)SSC Guru (975K reputation)SSC Guru (975K reputation)SSC Guru (975K reputation)SSC Guru (975K reputation)SSC Guru (975K reputation)SSC Guru (975K reputation)SSC Guru (975K reputation)

Group: General Forum Members
Points: 975148 Visits: 49307
tamirgerber - Wednesday, February 20, 2019 2:05 AM
Jeff Moden - Tuesday, February 19, 2019 9:58 PM
tamirgerber - Tuesday, February 19, 2019 6:51 PM
One could use sp_msForEachDB builtin stored procedure. No cursor, no loop, and less chance to get into security issues.


Not quite right. If you look at the actual code sp_msForEachDB and the procedure that calls, its a cursor/loop on steroids. ;-)

I am sorry for not being clear enough. My idea was that call of sp_msForEachDB eliminates a need to use cursor and loop explicitly. Less custom code - less headache :-)


Ah. Got it. Thanks for the feedback.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

When you put the right degree of spin on it, the number 318 is also a glyph that describes the nature of a DBAs job. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (975K reputation)SSC Guru (975K reputation)SSC Guru (975K reputation)SSC Guru (975K reputation)SSC Guru (975K reputation)SSC Guru (975K reputation)SSC Guru (975K reputation)SSC Guru (975K reputation)

Group: General Forum Members
Points: 975148 Visits: 49307
Peter Shilovich - Wednesday, February 20, 2019 3:06 AM
tamirgerber - Wednesday, February 20, 2019 2:05 AM
Jeff Moden - Tuesday, February 19, 2019 9:58 PM
tamirgerber - Tuesday, February 19, 2019 6:51 PM
One could use sp_msForEachDB builtin stored procedure. No cursor, no loop, and less chance to get into security issues.


Not quite right. If you look at the actual code sp_msForEachDB and the procedure that calls, its a cursor/loop on steroids. ;-)

I am sorry for not being clear enough. My idea was that call of sp_msForEachDB eliminates a need to use cursor and loop explicitly. Less custom code - less headache :-)
Thanks for the feedback Smile
I prefer not to use sp_msForEachDB here for two reasons. Firstly, becase of it is not documented. And secondly, this proc is intended to search for a text in user's DB.


Totally understood.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

When you put the right degree of spin on it, the number 318 is also a glyph that describes the nature of a DBAs job. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
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