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 |
sqlfresher2k7
Aged Yak Warrior
623 Posts |
Posted - 2008-07-08 : 17:02:47
|
I need to write a generic query which should give the results from all servers like develpement,testing,staging etc.select count(*)results from tablenameoutput:Server1 results------- --------Dev 10Test 20Stag 12 |
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2008-07-08 : 23:18:22
|
You need create linked servers to those servers then run the query with four-part name. |
 |
|
sqlfresher2k7
Aged Yak Warrior
623 Posts |
Posted - 2008-07-09 : 10:50:40
|
I am new to linked server can please help me abt the four-part name.. |
 |
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2008-07-09 : 22:17:37
|
Once created linked server, you can run query like: select count(*) results from lined_server.dbname.schema.tablename. Find details in books online. |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-10 : 01:22:36
|
You could also try using OPENROWSEThttp://doc.ddart.net/mssql/sql70/oa-oz_5.htm |
 |
|
|
|
|