Updating System Tables

  • Does anyone know if it is possible to update the code for a view and or procedure through the system tables (syscomments).

    We have about 400 views and procedures that are referencing TableA and we need to change them to point to new TableB. We have found a way to pull all of the objects that contain the text "TableA" out of the varbinary column ctext but we don't know how to update it.

    Are we barking up the wrong tree and just script the dbs to do a search and replace?

  • quote:


    ...Are we barking up the wrong tree and just script the dbs to do a search and replace?

    ...


    IMHO, Yes, you are. You'll probably become quite frustrated doing this the manual way...Is there a reason you don't want to use the Script Objects utility?

  • The scripting objects utility in Enterprise Manager? Yea, that was our last resort, we just wanted to attempt it this way. You know, something different that might come in handy one day.

  • quote:


    ...something different that might come in handy one day...


    I hear you. We have done some similar things in the past, but have found it is just easier and faster to use the EM for the scripting out of objects, then run a search and replace through QA.

    However, I'm sure if you get a good working proc that replaces table/column names you'd have a popular script for the site!

  • Alright, thanks for the advice.

Viewing 5 posts - 1 through 4 (of 4 total)

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