programatically find out is there''s a SQL installation

  • Before installing my product, I need my module to find out if there's a SQL server already installed and what are the directories - SQL server installation directory and the datafiles and log.

    I'm trying to search into the registry keys, but getting confused when multiple instances and/or versions are installed.

    What will be the easiest way to do that?

    Can somebody send me an export from the registry where there are both SQL 7 and 2000. I do not have such anymore and I cannot include it into my code...

    Thanks,

    MJ

  • This was removed by the editor as SPAM

  • Default Instance:

    Install Path: HKLM\Software\Microsoft\MSSQLServer\Setup\SQLPath

    If they are defined:

    Default Data File Path: HKLM\Software\Microsoft\MSSQLServer\MSSQLServer\DefaultData

    Default Log File Path: HKLM\Software\Microsoft\MSSQLServer\MSSQLServer\DefaultLog

    Named Instance:

    Install Path: HKLM\Software\Microsoft\Microsoft SQL Server\<Instance Name>\Setup\SQLPath

    If they are defined:

    Default Data File Path: HKLM\Software\Microsoft\Microsoft SQL Server\<Instance Name>MSSQLServer\DefaultData

    Default Log File Path: HKLM\Software\Microsoft\Microsoft SQL Server\<Instance Name>\MSSQLServer\DefaultLog

    K. Brian Kelley
    @kbriankelley

  • You could also run script to check the services list using WMI.

     

     

    --------------------
    Colt 45 - the original point and click interface

  • Thanks a lot, guys.

    What kind of script I can run to to check WMI?

    Is there a place to see an example?

    Thanks again, mj

  • Microsoft Script Repository:

    Services Scripts

    K. Brian Kelley
    @kbriankelley

  • I am looking for someting similar and I must not be searching correctly.

    I was looking for either a T-SQL or WMI or even Powershell script that can scan a registry or server looking for specific SQL components.

    I saw some references to xp_regread but I do not want to use that undocumentec procedure in a scheduled daily policy check.

    I looked at the Script Repository but only found the VB scan tool.

    Any suggestions would be appreciated.

  • I am looking for someting similar and I must not be searching correctly.

    I was looking for either a T-SQL or WMI or even Powershell script that can scan a registry or server looking for specific SQL components.

    I saw some references to xp_regread but I do not want to use that undocumentec procedure in a scheduled daily policy check.

    I looked at the Script Repository but only found the VB scan tool.

    Any suggestions would be appreciated.

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

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