Which Drive was SQL 2005 installed from?

  • Hello,

    I am trying to determine which drive SQL 2005 was installed from.

    Where is this information located. I tried to search the registry but I found nothing that would tell me.

    I would appreciate if someone had a query they could share.

    Thanks

    Gary

  • Try looking in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

    There are a number of GUIDs under that. For me, SQL was under {2373A92B-1C1C-4E71-B494-5CA97F96AA19}.

    Find the key & check the data in the InstallSource value.

    You can also check the setup log files under C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Files.



    Scott Duncan

    MARCUS. Why dost thou laugh? It fits not with this hour.
    TITUS. Why, I have not another tear to shed;
    --Titus Andronicus, William Shakespeare


  • Did you try to search file, sqlservr.exe

  • GF (3/11/2008)


    Hello,

    I am trying to determine which drive SQL 2005 was installed from.

    Where is this information located. I tried to search the registry but I found nothing that would tell me.

    I would appreciate if someone had a query they could share.

    Thanks

    Gary

    Installed "from"? As in where the install was loaded (network drive/cd)? Or where the current installation directory resides? As a former post states, you can simply search for the .exe, search the registry, or inside of SQL, you can run this:

    EXEC master.dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE',N'Software\Microsoft\MSSQLServer\Setup',N'SQLPath'

  • This is a good time to post some utilities that I have used before. There are functions to return several SQL Locations.

    http://sqldev.net/misc/SQLLocationFunctions.htm">

    http://sqldev.net/misc/SQLLocationFunctions.htm

  • Thanks Bob! great script!

  • The only credit I can take is that I found it on the net. I have used them in some code that I wrote.

    /* Not concerned about FROM clause for this routine. If this is needed, don't use this routine */

    SELECT @mySQL = 'RESTORE DATABASE [' + @DBName + '] WITH ' +

    CASE

    WHEN @Available = 0 THEN 'NORECOVERY' -- If Available is False then only option is NORECOVERY

    WHEN @Modifyable = 1 THEN 'RECOVERY' -- If Modifyable then just recover. This cannot be reversed

    ELSE 'STANDBY = ''' + MASTER.dbo.fn_SQLServerBackupDir() + '\ROLLBACK_UNDO_' + @DBName + '.BAK'''

    END

Viewing 7 posts - 1 through 6 (of 6 total)

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