Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Elidas
Starting Member
33 Posts |
Posted - 2008-05-13 : 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
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2008-05-13 : 05:27:27
|
right click on the query window, change connectionoruse linkedserver to query other dbs in other serverselseafaik, not possiblequote: 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
30421 Posts |
Posted - 2008-05-13 : 05:29:03
|
Use Spirit1's SSMSTools. E 12°55'05.25"N 56°04'39.16" |
|
|
Elidas
Starting Member
33 Posts |
Posted - 2008-05-13 : 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
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-05-13 : 12:52:24
|
setup linked server and use four part name like [instance].[database].[schema].[object]. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-05-13 : 12:59:08
|
Use OPENQUERY.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Database maintenance routines:http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx |
|
|
|
|
|
|
|