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
Old Hand
Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)

Group: General Forum Members
Points: 325 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



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

Group: Moderators
Points: 10724 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
SSCarpal Tunnel
SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)

Group: General Forum Members
Points: 4332 Visits: 1436

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
Old Hand
Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)

Group: General Forum Members
Points: 325 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 (10K reputation)

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

Services Scripts

K. Brian Kelley
@‌kbriankelley
swoozie
swoozie
Old Hand
Old Hand (306 reputation)Old Hand (306 reputation)Old Hand (306 reputation)Old Hand (306 reputation)Old Hand (306 reputation)Old Hand (306 reputation)Old Hand (306 reputation)Old Hand (306 reputation)

Group: General Forum Members
Points: 306 Visits: 438
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
Old Hand
Old Hand (306 reputation)Old Hand (306 reputation)Old Hand (306 reputation)Old Hand (306 reputation)Old Hand (306 reputation)Old Hand (306 reputation)Old Hand (306 reputation)Old Hand (306 reputation)

Group: General Forum Members
Points: 306 Visits: 438
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