Search Replace -- RRS feed

  • Question

  • Hi,

    I am working on an old database which has a lot of stored procedures, functions and views and has a particular string hard coded  example P32111 

    As part of a transition I need  to replace that string with a new one ( P32111 with P1221) 

    I know there are many tools to search SQL easily like Apex SQL ,RED Gate etc but any way to search/replace  without manual way 

    Many thanks in anticipation

    Tuesday, March 1, 2016 3:02 AM


  • You can find code of stored procedures, triggers and functions in sys.sql_modules view. So, you can create a script to get all of them into a sql and then do a search and replace.

    For every expert, there is an equal and opposite expert. - Becker's Law

    My blog

    My TechNet articles

    • Marked as answer by Matt800 Wednesday, March 2, 2016 8:40 AM
    Tuesday, March 1, 2016 3:18 AM