Hello,
I am writing a stored procedure that will query data from another database, but the database name is variable. Do I have to use a dynamic query? We dont want to use dynamic queries because of performance loss. But is there a way to do it without a dynamic query?
Example
GetData 'some_remote_db_name';
and the select statment would be like
SELECT data FROM data_base_name.table; --or something like that
Any help is greatly appriciated
Thanks
Software/Hardware used:
sql server 2005
ASKED:
July 19, 2010 3:20 PM
UPDATED:
February 14, 2012 10:24 AM