aajay
Technical User
- Oct 28, 2004
- 36
I have store procs in my database
I need to use table from different databases
all want to do is declare a variable and pass the database name to get the data
e.g
declare @dbname
set @dbname = Fortunedb
select name, id from
@dbname +'.'+ vwGiving_Gift_Journal_RPT
so I can change the @dbname to look data at other database which ofcourse have same schema.
any idea.
thanks,
I need to use table from different databases
all want to do is declare a variable and pass the database name to get the data
e.g
declare @dbname
set @dbname = Fortunedb
select name, id from
@dbname +'.'+ vwGiving_Gift_Journal_RPT
so I can change the @dbname to look data at other database which ofcourse have same schema.
any idea.
thanks,