Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TSQL question
Message
From
11/08/2000 17:36:12
 
 
To
11/08/2000 14:05:06
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
00404063
Message ID:
00404181
Views:
11
>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.



Ken,

From Books Online, on EXECUTE:

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:

USE master EXEC ("USE pubs") SELECT * FROM authors
Sylvain Demers
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform