Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Parameters to Specify Database???

Author  Topic 

chrpeter
Starting Member

31 Posts

Posted - 2008-04-21 : 16:02:52
Is this possible/how is it done?
I tried just going through and putting a @DBName.dbo.Table1
in the FROM clause but it said invalid object name @DBName ...

I also tried this in a stored proc, but it didn't work either:
quote:

EXEC('USE ' + @DBName)
*SELECT STATEMENT HERE*



Any suggestions?

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2008-04-21 : 16:15:42
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=94068


elsasoft.org
Go to Top of Page

chrpeter
Starting Member

31 Posts

Posted - 2008-04-21 : 16:23:12
Awesome, just what I needed thanks
Go to Top of Page
   

- Advertisement -