Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 auto updating stored procedures?
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

1 Posts

Posted - 04/12/2007 :  02:35:18  Show Profile  Reply with Quote
Is it possible to get SQL Server to automatically update the table/field names in your stored procedures when changing those table/field names in the database?

In (Som, Ni, Yak)

17689 Posts

Posted - 04/12/2007 :  02:37:23  Show Profile  Reply with Quote
No. Not possible. Can't think of any other automated method also.

Best way is have your stored procedure script to file and use FIND & REPLACE to do it


Go to Top of Page


United Kingdom
22859 Posts

Posted - 04/12/2007 :  03:24:45  Show Profile  Reply with Quote
We mechanically generate all our CRUD procedures, that helps with name changes.

You might be able to use SYSDEPENDS to locate procedures that reference a particular object.

We use unique names for all columns in the database prefixing each column's name with a mnemonic that represents the table - so a CUSTOMER table might have columns cust_ID, cust_Name, cust_Address ... - that makes it easier to guarantee finding all instances of an object's name. We also use the column name for any temporary @variables referencing that column - so @cust_ID_Start and @cust_ID_End for variables used in a Stored Procedure for a report range. They get found too ...

We have each Sproc and Trigger in a separate text file (and in a version control system) and it is then easy to do a global find & replace.

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000