Free SQL Server Learning - Using SQL Server DMVs to Help Improve Performance
solving sql server problems for millions of dbas and developers since 2006



SQL Server DBA Tips SQL Server Developer Tips SQL Server Business Intelligence Tips SQL Server Career Tips SQL Server Tip Categories SQL Server Tutorials SQL Server Webcasts SQL Server Whitepapers SQL Server Tools SQL Server Questions and Answers MSSQLTips Authors About MSSQLTips SQL Server User Groups SQL Server Events I am MSSQLTips MSSQLTips Advertising Options

MSSQLTips Facebook Page MSSQLTips LinkedIn Page MSSQLTips RSS Feed MSSQLTips Pinterest Page MSSQLTips Twitter Page MSSQLTips Google+ Page




































SQL Product Highlight

Idera - SQL safe backup

SQL Server backup compression with network fault tolerance and zero impact encryption

  • Fast, compressed & encrypted SQL backup and restore
  • SQL Server backup compression of 95%
  • At least 50% faster than native SQL backups
  • Learn more!











SQL Server Central Management Servers System Tables

By:   |   Read Comments (2)   |   Related Tips: 1 | 2 | 3 | 4 | More > Central Management Servers

Problem

I have SQL Server Central Management Servers setup in my environment. How can I get a list of the registered servers and their associated properties? Are there any queries I can issue? Check out this tip to learn more.

Solution

Sometimes we came across a situation where we need to query the SQL Server Central Management Servers to get the list of the registered servers and groups. You can query the two MSDB system tables below to get a list of the registered servers and their groups.

  • msdb.dbo.sysmanagement_shared_registered_servers_internal
  • msdb.dbo.sysmanagement_shared_server_groups_internal

We can use these system tables for the following:

  • Find out the list of registered servers and their groups
  • Find out servers which are registered twice in different folders
  • Compare the query result to check out the servers registered in an incorrect group or decommissioned servers

Query to list server groups and types

USE msdb;
GO
/* Query to list out Server Groups and Types */
SELECT *
FROM msdb.dbo.sysmanagement_shared_server_groups_internal;
GO

query the sql server cms to get a list of  servers and groups


Query to list the registered servers

USE msdb ;
GO
/* Query to list out the registered servers */
SELECT * 
FROM msdb.dbo.sysmanagement_shared_registered_servers_intrnal;
GO

query to the list of registered servers


Query to list the server and groups

/* Servers and groups */
SELECT DISTINCT groups.name AS 'Server Group Name'
     ,svr.server_name AS 'Server Name'
FROM msdb.dbo.sysmanagement_shared_server_groups_internal groups 
INNER JOIN msdb.dbo.sysmanagement_shared_registered_servers_internal svr
 ON groups.server_group_id = svr.server_group_id;
GO

use queries from sql server cms


Next Steps



Last Update: 5/23/2011

About the author



Print  
Become a paid author


Comments and Feedback:

Monday, May 23, 2011 - 1:32:07 PM - Abhi Read The Tip

Hi Jugal,

Thanks for this tip, but its working only in SQL 2008.

what about 2005 sql server?

 

Thanks in advance,

Abhi


Tuesday, May 24, 2011 - 1:38:51 AM - Jugal Read The Tip

Hi Abhi,

CMS is SQL Server 2008 feature. You can register the lower SQL Server version in CMS, but you must need atleast 1 SQL Server 2008 instance. That's why you are not able to in lower versions.

You can query it in SQL Server 2008 only.

Thanks,

Jugal SHah

 

 



Post a Comment or Question

Keep it clean and stay on the subject or we may delete your comment.
Your email address is not published. Required fields are marked with an asterisk (*)

*Name   *Email Notify for updates

Signup for our newsletter


Comments
*Enter Code refresh code


 
Sponsor Information
SQL Server having some performance issues? Idera SQL check. FREE SQL Server enhancement.

SQL Monitor: prioritize your SQL Server workload with easy-to-use performance monitoring

Need SQL Server help and not sure where to turn? Reach out to expert consultants in the USA for a Health Check.

In two mouse clicks view SQL bottlenecks. With ZERO impact pinpoint all poor performing SQL with 100% accuracy.

Optimizing SQL Server performance can be a daunting task. Or is it?


Copyright (c) 2006-2013 Edgewood Solutions, LLC All rights reserved
privacy | disclaimer | copyright | advertise | about
authors | contribute | feedback | giveaways | user groups
Some names and products listed are the registered trademarks of their respective owners.


Edgewood Solutions LLC | MSSharePointTips.com | MSSQLTips.com