Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
USE command with SQL Server Express
Message
From
25/09/2007 18:18:48
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
USE command with SQL Server Express
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01256808
Message ID:
01256808
Views:
61
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
Map
View

Click here to load this message in the networking platform