T-SQL to get all available instances on the server

  • hi,

    can any body help me out on T-SQL to get all available instance names on the server.

  • 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

  • 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

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply