Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TSQL question
Message
From
11/08/2000 17:54:08
 
 
To
11/08/2000 17:36:12
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
00404063
Message ID:
00404185
Views:
11
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform