Friday 3 August 2012

instances installed on a server

 -- ******************************************** */ -- Description */ -- ============ */ -- Script to find SQL instances installed on a server -- =============================================*/ -- Compatibility : 2000+ */ -- ******************************************** */ -- Create Temporary table to store the data Create Table #SQLInstances ( Value nvarchar(100), InstanceName nvarchar(100), Data nvarchar(100)) -- Read Data from Registery Insert into #SQLInstances EXECUTE xp_regread @rootkey = 'HKEY_LOCAL_MACHINE', @key = 'SOFTWARE\Microsoft\Microsoft SQL Server', @value_name = 'InstalledInstances' Select InstanceName from #SQLInstances -- Clear the temp table drop table #SQLInstances

No comments:

Post a Comment