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

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Changing Linked Server Names Between Environments

Author  Topic 

drsloat
Starting Member

45 Posts

Posted - 2007-05-01 : 18:32:27
If I have stored procedures that reference linked servers, is there any way to avoid changing the procedures when moving between environments (dev, qa, prod)?

Do i resort to dynamic sql? Use case statements to switch between environments?

Any experience or advice is appreciated.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-05-01 : 18:57:16
Have the stored procedures reference an alias. Create an alias on the database server that uses the same name in the stored procedure and have the alias point to the actual environment you are trying to get to. If you ever need to switch environments, you can simply update the alias.

To add aliases, you can use Client Network Utility for 2000 or earlier or SQL Server Configuration Manager for 2005.

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -