Friday, March 23, 2012

How to determine if SQl Server is installed

What would the best way be to programmatically determine if SQL Server is
installed?
Looking in a specific folder on the C: drive would not be useful, since it
might be installed in a non-standard location. And scanning all available
hard disks is not very desirable.
The best solution would be if there's a registry key that gives me the
location.
Thanks,
PeterWhat type of application do you plan to use to do this? VB? Etc. Your best
bet would be to look for the SQL Service.
"jpstewart" <jpstewart@.discussions.microsoft.com> wrote in message
news:CC3DE372-56C7-45B8-932B-C6485C54F759@.microsoft.com...
> What would the best way be to programmatically determine if SQL Server is
> installed?
> Looking in a specific folder on the C: drive would not be useful, since it
> might be installed in a non-standard location. And scanning all available
> hard disks is not very desirable.
> The best solution would be if there's a registry key that gives me the
> location.
> Thanks,
> Peter
>|||> The best solution would be if there's a registry key that gives me the
> location.
What location are you referring to?
The reg key for a default instance is:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MS
SQLServer
And for named instances:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Mi
crosoft SQL Server
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"jpstewart" <jpstewart@.discussions.microsoft.com> wrote in message
news:CC3DE372-56C7-45B8-932B-C6485C54F759@.microsoft.com...
> What would the best way be to programmatically determine if SQL Server is
> installed?
> Looking in a specific folder on the C: drive would not be useful, since it
> might be installed in a non-standard location. And scanning all available
> hard disks is not very desirable.
> The best solution would be if there's a registry key that gives me the
> location.
> Thanks,
> Peter
>

No comments:

Post a Comment