General information
Forum:
Microsoft SQL Server
Title:
USE command with SQL Server Express
Environment versions
SQL Server:
SQL Server 2005
SQL Server Express allows you to "attach" directly to a database file using
the AttachDBFilename property in the connection builder.
When the file is connected, it can be seen in the Server Management Studio
like the following:
C:\myfolder\mydatabase.mdf
Here's my challenge. We query multiple databases in the same query. In the
past this was simple because you'd just add the name of the database in
front of the table name like follows:
mydatabase.dbo.mytable
and we'd also use the "USE" command to set a database when we were working
with more than one:
use mydatabase
select * from mytable
However, I'm not sure now to do this with these Express databases that have
been attached using the above procedure.
Can anyone please help me on this. I'm getting errors when I try the
following:
use C:\MYFOLDER\MYDATABASE.MDF
Thanks.
bob bartel
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