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 |
|
rudba
Constraint Violating Yak Guru
415 Posts |
Posted - 2010-02-17 : 15:30:25
|
| How can we display systemprocesses from multiple sql servers in a single querry? e.g i have sql1,sql2,sql3I tried following but it works on single server.select @@servername ,a.[name],b.Status,b.hostnamefrom sys.databases a, sys.sysprocesses bwhere a.database_id=b.dbid |
|
|
rudba
Constraint Violating Yak Guru
415 Posts |
Posted - 2010-02-17 : 19:43:43
|
| Anybody have idea? |
 |
|
|
pk_bohra
Master Smack Fu Yak Hacker
1182 Posts |
Posted - 2010-02-17 : 22:40:20
|
| If all the servers(you want to query) are linked then you can try using the four part name.select @@servername as ServerName ,a.[name],b.Status,b.hostnamefrom sys.databases a, sys.sysprocesses bwhere a.database_id=b.dbidUnionselect 'NextServer' as ServerName,a.[name],b.Status,b.hostnamefrom [NextServer].master.sys.databases a, [NextServer].master.sys.sysprocesses bwhere a.database_id=b.dbidI am not sure whether this is the best way or not.. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
pk_bohra
Master Smack Fu Yak Hacker
1182 Posts |
Posted - 2010-02-21 : 05:02:37
|
quote: Originally posted by rudba Thanks i got the server name but i have more than 2 server so i get same count from both. I tried below script
On which server you are executing this query ? In case you are executing the query on [sql-edd3] server then you will get same result. Make sure that you are executing the query on other server ( and not [sql-edd3] ) to get different output.Please check and confirm. |
 |
|
|
|
|
|
|
|