SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 auto updating stored procedures?
 New Topic  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)

17684 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
22692 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  
 New 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.08 seconds. Powered By: Snitz Forums 2000