Seach and Updating Stored Procedures

  • I have seen tons of examples on how you can search all the stored procedures for a specfic text value. Is it possible that once you find the 'text value' that you can update the stored procedure with a new value? My problem is they are replacing several of our servers and I need to update all the current stored procedures with the new server names. You think they'd just use the same server names wouldn't you.

  • yes and no.

    you can certainly search stored procedure text and there's lots of code and discussion on this point, it can be tricky(ier ) where procs are very large and cross page boundries. As for updating in this manner, e.g. find and replace - I'd really hope that you couldn't do this

    Your best bet would to be use a source control system.

    I've written scripts to most things but I've not ( to date ) written a script to search procs and then extract them, make changes and put them back - it would be quite a project to do so I figure.

    [font="Comic Sans MS"]The GrumpyOldDBA[/font]
    www.grumpyolddba.co.uk
    http://sqlblogcasts.com/blogs/grumpyolddba/

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply