Login
Products
Sales
Support
Downloads
About
Home
»
Technical Support
»
ElevateDB Technical Support
»
Support Forums
»
Search Forums
»
Search Results
»
View Thread
View Thread
The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Change database context
Thu, Apr 23 2009 7:36 AM
Permanent Link
Dan
Can I change the database context in a script procedure?
Inside a script executed in context of database A, I want to
create
a table in another
database B for example.
Thanks.
Thu, Apr 23 2009 10:28 AM
Permanent Link
Fernando Dias
Team Elevate
Dan,
> Can I change the database context in a script procedure?
In a script, yes; in a stored procedure, no.
> Inside a script executed in context of database A, I want to
create
a
> table in another
> database B for example.
In a script or job, you can close the currently opened databse and open a
new one with the USE statement, like this:
...
USE B;
EXECUTE IMMEDIATE '
CREATE
TABLE X .... ';
USE A;
...
--
Fernando Dias
[Team Elevate]