From: CharlesL on 12 Aug 2010 10:39 Hello, looking for a quick way to find out all the SQL server versions in a domain.... Currently I have a table with all the SQL names in the first column, such as: Table Name: SERVERS SERVERS SQLSERVER1 SQLSERVER2 SQLSERVER3 SQLSERVER4 SQLSERVER5 SQLSERVER6 etc etc I would like to run a serverproperty query against each of these names without having to connect to each of the servers Managment Studios and then running a query - so my assumption is I need to have something like: USE @SERVERNAME Use a loop and Define the @SERVERNAME parameter with the next entry in the field from the above table, and then for each server run SELECT SERVERPROPERTY ('MachineName') as Instance, SERVERPROPERTY ('Edition') as Edition, SERVERPROPERTY ('ProductVersion') as Version, SERVERPROPERTY ('ProductLevel') as [Product Level], SERVERPROPERTY ('LicenseType') as License, SERVERPROPERTY ('NumLicenses') as [License Number], SERVERPROPERTY ('ServerName') as [Server Name], SERVERPROPERTY ('productlevel') as Level, Anyone have any ideas? LOOP until it reads through all the
From: Plamen Ratchev on 12 Aug 2010 11:18 If you create linked servers to each of the servers then you can execute a query against each linked server and obtain the info. But without connecting to each server instance you cannot retrieve it. -- Plamen Ratchev http://www.SQLStudio.com
|
Pages: 1 Prev: script default constraints Next: Defining a date variable as null in SQL Server 2008 |