Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TSQL question
Message
De
11/08/2000 17:54:08
 
 
À
11/08/2000 17:36:12
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Divers
Thread ID:
00404063
Message ID:
00404185
Vues:
12
>Changes in database context last only until the end of the EXECUTE statement. For example, after the EXEC in this example, the database context is master:


so - how can I "use" a database that is passed in as a parameter or determined somehow and stored in a variable - short of putting everything in one big variable and executing it?

specifically (in pseudo code) I want to:

1 - save current database (which can be anything) in variable
2 - switch to another known database
3 - do some stuff
4 - switch back to orignal database

What is best way to accomplish this?

TIA!
Ken B. Matson
GCom2 Solutions
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform