Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
microsoft.public.sqlserver.programming
change db name at runtime?
Test Test
3/22/2007 7:30:00 PM
I've this update sql statement which I want to run on 6 different dbs.
All dbs reside on the same server. Is there a way I can change the db
name at runtime? what I want is when I run the update on 1st db, it
should be connecting to next db upon the completion of 1st and then
connect to 3rd db (without me changing the db name). I am trying to
avoid changing the db name manually and run it again. Any help would be
appreciated!
*** Sent via Developersdex
http://www.develop...
***
1 Answer
Codeman
3/23/2007 2:26:00 AM
0
"Test Test" wrote:
> I've this update sql statement which I want to run on 6 different dbs.
> All dbs reside on the same server. Is there a way I can change the db
> name at runtime? what I want is when I run the update on 1st db, it
> should be connecting to next db upon the completion of 1st and then
> connect to 3rd db (without me changing the db name). I am trying to
> avoid changing the db name manually and run it again. Any help would be
> appreciated!
>
>
> *** Sent via Developersdex
http://www.develop...
***
>
If the databases are on the same instance you can change the database with a
use
statement, for example:
Use DB1
Go
SQL Statement
Use DB2
Go
SQL Statement
....
Use DB6
Go
SQL Statement
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
change db name at runtime?
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password