SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


programatically find out is there''s a SQL installation


programatically find out is there''s a SQL installation

Author
Message
mjschwenger
mjschwenger
SSC Eights!
SSC Eights! (909 reputation)SSC Eights! (909 reputation)SSC Eights! (909 reputation)SSC Eights! (909 reputation)SSC Eights! (909 reputation)SSC Eights! (909 reputation)SSC Eights! (909 reputation)SSC Eights! (909 reputation)

Group: General Forum Members
Points: 909 Visits: 65
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



Site Owners
Site Owners
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: Administrators
Points: 12685 Visits: 20
No one has responded to this topic yet. Even if you don't have a complete answer, the original poster will appreciate any thoughts you have!
K. Brian Kelley
K. Brian Kelley
Keeper of the Duck
Keeper of the Duck (25K reputation)

Group: Moderators
Points: 25070 Visits: 1917
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
philcart
philcart
SSCrazy Eights
SSCrazy Eights (9.8K reputation)SSCrazy Eights (9.8K reputation)SSCrazy Eights (9.8K reputation)SSCrazy Eights (9.8K reputation)SSCrazy Eights (9.8K reputation)SSCrazy Eights (9.8K reputation)SSCrazy Eights (9.8K reputation)SSCrazy Eights (9.8K reputation)

Group: General Forum Members
Points: 9829 Visits: 1441

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



Hope this helps
Phill Carter
--------------------
Colt 45 - the original point and click interface

Australian SQL Server User Groups - My profile
Phills Philosophies
Murrumbeena Cricket Club
mjschwenger
mjschwenger
SSC Eights!
SSC Eights! (909 reputation)SSC Eights! (909 reputation)SSC Eights! (909 reputation)SSC Eights! (909 reputation)SSC Eights! (909 reputation)SSC Eights! (909 reputation)SSC Eights! (909 reputation)SSC Eights! (909 reputation)

Group: General Forum Members
Points: 909 Visits: 65
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



K. Brian Kelley
K. Brian Kelley
Keeper of the Duck
Keeper of the Duck (25K reputation)

Group: Moderators
Points: 25070 Visits: 1917
Microsoft Script Repository:

Services Scripts

K. Brian Kelley
@‌kbriankelley
swoozie
swoozie
Right there with Babe
Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)

Group: General Forum Members
Points: 780 Visits: 441
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.
swoozie
swoozie
Right there with Babe
Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)Right there with Babe (780 reputation)

Group: General Forum Members
Points: 780 Visits: 441
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search