Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

T-SQL to get all available instances on the server Expand / Collapse
Author
Message
Posted Friday, December 14, 2012 12:26 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 7:27 AM
Points: 208, Visits: 1,039
hi,
can any body help me out on T-SQL to get all available instance names on the server.
Post #1396783
Posted Friday, December 14, 2012 1:07 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, March 14, 2014 3:23 PM
Points: 31, Visits: 43
DECLARE @GetInstances TABLE
( Value nvarchar(100),
InstanceNames nvarchar(100),
Data nvarchar(100))

Insert into @GetInstances
EXECUTE xp_regread
@rootkey = 'HKEY_LOCAL_MACHINE',
@key = 'SOFTWARE\Microsoft\Microsoft SQL Server',
@value_name = 'InstalledInstances'

Select InstanceNames from @GetInstances
Post #1396800
Posted Saturday, December 15, 2012 8:46 PM


SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, September 19, 2014 1:08 PM
Points: 80, Visits: 351
This renaming of a server article has a code snipet to find all the instances.

http://craftydba.com/?p=1832



John Miner
Crafty DBA
www.craftydba.com
Post #1396959
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse