How can I pull out specific data from within the registry?

  • Hello All,

    New to the DBA field and am learning my way through MS SQL 2000.

    What I need to find out is the company name and user name originally provided for a SQL Server  installation on a particular box.

    I did not perform the install so it could be anything.

    I manually searched the registry (HK LocalMachine\Software\Microsoft\MSSQL) with no luck.

    I did see a folder titled registration but alas it contained no information.

    I googled to no avail (although I did come across the xp_regread stored procedure but I haven't been able to get it to work for me).

    Any ideas? I need to provide the info to our corporate security team.

    Thanks in advance for any suggestions!

  • G'day

    I googled "SQL SERVER READ REGISTRY".  The first link was this: http://www.4guysfromrolla.com/webtech/101499-1.shtml

    From that link:

    USE MasterEXEC xp_regread 'HKEY_LOCAL_MACHINE',                'SOFTWARE\Microsoft\MSSQLServer\Setup',                'SQLPath'
    Hope this helps
    Wayne
  • Thanks for the help Wayne!

    Using your Google criteria led me here to an answer that should work:

    DECLARE @datapath varchar(255)EXEC master..xp_regread'HKEY_LOCAL_MACHINE','SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\CurrentVersion','RegisteredOwner',@datapath OUTPUTPRINT @datapath
  • Just a little warning:

    The registry keys for named instances are different than for the default

     


    * Noel

  • I wasn't aware of that!

    Thanks for the warning...

Viewing 5 posts - 1 through 4 (of 4 total)

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