To manage multiple servers as a DBA, you usually need to collect information from multiple servers. In SQL Server 2008, the general practice is to use the linked server or a cell phone from a single server and then summarize the information to the central server. These require many additional configurations.
SQL Server 2008 provides a new function to execute statements on multiple servers at the same time.
Implementation Method: create a local server group, or create a central management server and one or more server groups, and create one or more registered servers in these groups, then query the entire group.You can merge the results returned by the query into a single result pane, or return these results in a separate result pane.The result set may contain additional columns, that is, the server name and login name used for queries on each server. You can only use Windows authentication to register a central management server and a secondary server.
Because the returned data protects the server and login name, it is very convenient for us to process data later.
Execute statements for multiple configuration targets at the same time
In SQL Server Management studio"View"Click"Registered servers".
Expand a central management server, right-click a server group, and point"Connection"And then click"New query".
In the query Editor, type and execute a Transact-SQL statement, for example:
Use mastergoselect * From sysdatabases; go
By default, the Results pane combines query results from all servers in the server group.
The following is the query result (very convenient ):