C'mon - there has got to be away to do this:
1 - store current (unknown) database in var -
set @db = db_name(db_id) works just fine
2 - use another known data base ie
use MSDB 3 - do a bunch of stuff - multiple lines - more than is practical to put in a string and execute all at once
4 - somehow - re "use" the original database - and this is the problem
trying all combinations of
use @db, use (@db) , etc don't work.
Trying to Execute("use " + @db) doesn't work because context switches back immediately after execute to what it was before execute.
Can anyone help here?
TIA,
Ken
Ken B. Matson
GCom2 Solutions