Hi:
The easy part is the databases will be on the same server. However at the moment I am writing code in database SOMEDATABASE_TEST which is accessing objects in SOMEOTHERDATABASE_TEST. When its time to go to production the names are going to change to SOMEDATABASE and SOMEOTHERDATABASE. However the queries in SOMEDATABASE_TEST stored procedures read:
select * from SOMEOTHERDATABASE_TEST.dbo.SOMETABLE
the goal would be to have some variable @@crossdatabasename = SOMEOTHERDATABASE_TEST
then all the calls would look like
select * from @@crossdatabasename.dbo.SOMETABLE
We are using sql server 2008 r2
What is the best way around this?
Thanks
Software/Hardware used:
sql server 2008 r2
ASKED:
January 30, 2011 5:03 PM
UPDATED:
February 2, 2011 1:51 PM