Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
USE command with SQL Server Express
Message
De
25/09/2007 18:18:48
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
USE command with SQL Server Express
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01256808
Message ID:
01256808
Vues:
62
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform