Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TSQL question
Message
De
11/08/2000 14:05:06
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
TSQL question
Divers
Thread ID:
00404063
Message ID:
00404063
Vues:
54
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform