You can use the Execute command. Try this code in the Query Analyzer:
Declare @cString As Char(100)
Set @cString = "Use Northwind"
Execute(@cString)
In your case, it is very simple to qualify the database. For example, to fully reference the customers table in the Northwind database:
northwind.dbo.customers
The following code will work:
Declare @String As char(100)
Set @string = "Select * From northwind.dbo.customers"
Execute(@string)
HTH
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only