>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