
POSTED: Feb 14, 2012 3:00 PM (GMT)
I don’t think you are going to find a way to do it without dynamic SQL.

POSTED: Feb 15, 2012 3:42 PM (GMT)
The answer suggested in the Wiki would work if you have a pre-defined set of possible database names.
If the database names are truly “variable” and not known beforehand, that solution wouldn’t work.

POSTED: Feb 21, 2012 12:05 AM (GMT)
What is the purpose of using database in variable? Are you dealing with only one database that is going to be query or you expect that variable could hold the name one of many databases. Is the name of database or databases known before you query?
















