Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
This is silly
Message
From
17/08/2000 17:30:24
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
This is silly
Miscellaneous
Thread ID:
00406428
Message ID:
00406428
Views:
50
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
Next
Reply
Map
View

Click here to load this message in the networking platform