| Author |
Topic  |
|
|
Elidas
Starting Member
Spain
33 Posts |
Posted - 05/13/2008 : 05:16:00
|
How can I connect to another sqlserver instances using a SQL Query Analyzer command? I mean, something like this:
connect (server1.instance1, user, pass) ?? SELECT * FROM MYTABLE; connect (server1.instance2, user, pass) ?? SELECT * FROM MYTABLE; connect (server1.instance3, user, pass) ?? SELECT * FROM MYTABLE;
PD: I know I can click in File-->Connect-->etc..., but I want to do this with a T-SQL command |
|
|
jen
Flowing Fount of Yak Knowledge
Sweden
4110 Posts |
Posted - 05/13/2008 : 05:27:27
|
right click on the query window, change connection or use linkedserver to query other dbs in other servers else afaik, not possible
quote: Originally posted by Elidas
How can I connect to another sqlserver instances using a SQL Query Analyzer command? I mean, something like this:
connect (server1.instance1, user, pass) ?? SELECT * FROM MYTABLE; connect (server1.instance2, user, pass) ?? SELECT * FROM MYTABLE; connect (server1.instance3, user, pass) ?? SELECT * FROM MYTABLE;
PD: I know I can click in File-->Connect-->etc..., but I want to do this with a T-SQL command
-------------------- keeping it simple... |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
Sweden
29138 Posts |
Posted - 05/13/2008 : 05:29:03
|
Use Spirit1's SSMSTools.
E 12°55'05.25" N 56°04'39.16" |
 |
|
|
Elidas
Starting Member
Spain
33 Posts |
Posted - 05/13/2008 : 07:38:45
|
| I cant belive it is impossible to make a new connection to a different server from query analyzer, what I am asking is a simple command like for example has oracle in sqlplus: "connect sys\password@database" |
 |
|
|
sodeep
Flowing Fount of Yak Knowledge
USA
7173 Posts |
Posted - 05/13/2008 : 12:52:24
|
setup linked server and use four part name like [instance].[database].[schema].[object].
|
 |
|
|
tkizer
Almighty SQL Goddess
USA
35007 Posts |
|
| |
Topic  |
|