jimmythegeek
Programmer
What is the best way to handle referring to dev and production servers without "re-referencing" all your code? I am just starting this project, so I want to do it right. Currently we get a nightly dump of data to another server and database and here is the reference to the method table in it's current location;
Select * from vlib2.heis_snapshot.dbo.method
The "vlib2" server is the dev server, and the production server is "vlib3". So how do I avoid having to change ALL server references from "vlib2", to "vlib3" (there will be hundreds) when it goes to production. I know you can use find and replace, but that is not the right solution. I would like to simply change a "constant" to 'vlib3' and have all the code use that "constant" (I realize TSQL doesn't use global constants in their true sense, but I can use a function to return the string, or whatever).
I tried using a variable, but can't seem to get the right syntax in the FROM portion of the statement.
Thanks in advance for any input.
Jim Lunde
We all agree your theory is crazy, but is it crazy enough?
Select * from vlib2.heis_snapshot.dbo.method
The "vlib2" server is the dev server, and the production server is "vlib3". So how do I avoid having to change ALL server references from "vlib2", to "vlib3" (there will be hundreds) when it goes to production. I know you can use find and replace, but that is not the right solution. I would like to simply change a "constant" to 'vlib3' and have all the code use that "constant" (I realize TSQL doesn't use global constants in their true sense, but I can use a function to return the string, or whatever).
I tried using a variable, but can't seem to get the right syntax in the FROM portion of the statement.
Thanks in advance for any input.
Jim Lunde
We all agree your theory is crazy, but is it crazy enough?