Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sundarakshi
Starting Member
1 Post |
Posted - 2005-06-30 : 00:26:06
|
| Hi,I have to list the system names which has sql Server installed. How it can be done in C#.NET.Help Me PlzRegardsSomu |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-06-30 : 01:04:47
|
| Not sure whether this is effient methodSearch for the file master.mdf, if it is found, then there is chance SQL Server is installedWhy do you want to do this?MadhivananFailing to plan is Planning to fail |
 |
|
|
hgorijal
Constraint Violating Yak Guru
277 Posts |
Posted - 2005-06-30 : 06:03:44
|
| Check to see if the SQL Server Service is running....Now..wait.. I am not asking you to open Services MMC and look for it in every server.Run this VB Script and parse the results..(Change the variable in the first line to your server name)[code]strComputer = "YOUR_COMPUTER_NAME"Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")Set colRunningServices = objWMIService.ExecQuery("Select * from Win32_Service")For Each objService in colRunningServices If Mid(objService.DisplayName,1,5) = "MSSQL" Then Wscript.Echo objService.DisplayName & VbTab & objService.State end IfNext[\code]Hemanth GorijalaI Came. I Saw, I Normalized. |
 |
|
|
|
|
|