Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TSQL question
Message
From
11/08/2000 14:05:06
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
TSQL question
Miscellaneous
Thread ID:
00404063
Message ID:
00404063
Views:
53
Hi,
why oh why does the following (as run from query analyzer) not work?

Execute('use MyDataBase')

it seems to flash for a millisecond and then ends up on the same database as I started?

plain old - 'use MyDataBase'- of course - works fine.

This is actually part of a larger problem I'm trying to store the current database in a variable - change databases and do some stuff -
and then switch back to the original database. I won't know what the original database is so I'm using - @myvar = db_name(db_id()) - which pulls it fine - but I can't get code to set it back!?!?!

What is the best way too handle this?

Thanks!
Ken B. Matson
GCom2 Solutions
Next
Reply
Map
View

Click here to load this message in the networking platform