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?
and the select statment would be like
SELECT data FROM data_base_name.table; --or something like that
Any help is greatly appriciated
sql server 2005
July 19, 2010 3:20 PM
February 14, 2012 10:24 AM