|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Is the SQL Server Service Running?Can Enterprise Manager tell us *definitively* if the SQL Server service is
running/started on a particular SQL Server (where the SQL Server is not the local machine on which EM is running)? What is the most reliable way to determine if the SQL Server service is in fact up and running on any SQL server (assuming local admin access to the server is possible)? Thanks! Guadala,
1. Enterprise Manager 2. SQL Server Service Manager 3. Admin Tools --> Services --> connect to another machine 4. NET 5. SQL-DMO 6. WMI 7. WSH HTH Jerry Show quote "Guadala Harry" <G***@BeansAndTacos.org> wrote in message news:Odxvj5Y1FHA.464@TK2MSFTNGP15.phx.gbl... > Can Enterprise Manager tell us *definitively* if the SQL Server service is > running/started on a particular SQL Server (where the SQL Server is not > the local machine on which EM is running)? > > What is the most reliable way to determine if the SQL Server service is in > fact up and running on any SQL server (assuming local admin access to the > server is possible)? > > Thanks! > or using terminal services or VNC program
Show quote "Jerry Spivey" wrote: > Guadala, > > 1. Enterprise Manager > 2. SQL Server Service Manager > 3. Admin Tools --> Services --> connect to another machine > 4. NET > 5. SQL-DMO > 6. WMI > 7. WSH > > HTH > > Jerry > > "Guadala Harry" <G***@BeansAndTacos.org> wrote in message > news:Odxvj5Y1FHA.464@TK2MSFTNGP15.phx.gbl... > > Can Enterprise Manager tell us *definitively* if the SQL Server service is > > running/started on a particular SQL Server (where the SQL Server is not > > the local machine on which EM is running)? > > > > What is the most reliable way to determine if the SQL Server service is in > > fact up and running on any SQL server (assuming local admin access to the > > server is possible)? > > > > Thanks! > > > > > Thanks Jerry and enric... But I was hoping to get your perspective on how we
can know *for sure* (thus my hilighting of *definitively*) in the OP! Let me put it another way. Suppose someone put a loaded gun to your head and said they'd pull the trigger if you answered this question incorrectly: "Is the SQL Server service running/started on our SQL Server?" In that situation, which of the 7 methods you listed would you use? Remember, you'd get shot in the head if the method you chose told you the wrong answer. - I hope this clarifies what I'm after! Thanks! Show quote "Jerry Spivey" <jspi***@vestas-awt.com> wrote in message news:eyRm1%23Y1FHA.3720@TK2MSFTNGP14.phx.gbl... > Guadala, > > 1. Enterprise Manager > 2. SQL Server Service Manager > 3. Admin Tools --> Services --> connect to another machine > 4. NET > 5. SQL-DMO > 6. WMI > 7. WSH > > HTH > > Jerry > > "Guadala Harry" <G***@BeansAndTacos.org> wrote in message > news:Odxvj5Y1FHA.464@TK2MSFTNGP15.phx.gbl... >> Can Enterprise Manager tell us *definitively* if the SQL Server service >> is running/started on a particular SQL Server (where the SQL Server is >> not the local machine on which EM is running)? >> >> What is the most reliable way to determine if the SQL Server service is >> in fact up and running on any SQL server (assuming local admin access to >> the server is possible)? >> >> Thanks! >> > > It's ok. Very clear...
One solution would be the following: -Open a DOS session -Launch NET START statement -Retrieves the list -Look for 'MSSQLSERVER' If appears, it's running. Of course, these above steps could be done from a stored procedure or a snippet of VB code, WMI, etc... Regards, Enric Show quote "Guadala Harry" wrote: > Thanks Jerry and enric... But I was hoping to get your perspective on how we > can know *for sure* (thus my hilighting of *definitively*) in the OP! > > Let me put it another way. Suppose someone put a loaded gun to your head and > said they'd pull the trigger if you answered this question incorrectly: "Is > the SQL Server service running/started on our SQL Server?" > > In that situation, which of the 7 methods you listed would you use? > Remember, you'd get shot in the head if the method you chose told you the > wrong answer. > > - I hope this clarifies what I'm after! > > Thanks! > > > > > "Jerry Spivey" <jspi***@vestas-awt.com> wrote in message > news:eyRm1%23Y1FHA.3720@TK2MSFTNGP14.phx.gbl... > > Guadala, > > > > 1. Enterprise Manager > > 2. SQL Server Service Manager > > 3. Admin Tools --> Services --> connect to another machine > > 4. NET > > 5. SQL-DMO > > 6. WMI > > 7. WSH > > > > HTH > > > > Jerry > > > > "Guadala Harry" <G***@BeansAndTacos.org> wrote in message > > news:Odxvj5Y1FHA.464@TK2MSFTNGP15.phx.gbl... > >> Can Enterprise Manager tell us *definitively* if the SQL Server service > >> is running/started on a particular SQL Server (where the SQL Server is > >> not the local machine on which EM is running)? > >> > >> What is the most reliable way to determine if the SQL Server service is > >> in fact up and running on any SQL server (assuming local admin access to > >> the server is possible)? > >> > >> Thanks! > >> > > > > > > > You pointed out one of the methods I didn't think about.
Thanks! Show quote "Enric" <En***@discussions.microsoft.com> wrote in message news:DB62D4E5-2588-4FDF-9D47-0FF3DEDABE74@microsoft.com... > It's ok. Very clear... > > One solution would be the following: > > -Open a DOS session > -Launch NET START statement > -Retrieves the list > -Look for 'MSSQLSERVER' > > If appears, it's running. > Of course, these above steps could be done from a stored procedure or a > snippet of VB code, WMI, etc... > > Regards, > Enric > > "Guadala Harry" wrote: > >> Thanks Jerry and enric... But I was hoping to get your perspective on how >> we >> can know *for sure* (thus my hilighting of *definitively*) in the OP! >> >> Let me put it another way. Suppose someone put a loaded gun to your head >> and >> said they'd pull the trigger if you answered this question incorrectly: >> "Is >> the SQL Server service running/started on our SQL Server?" >> >> In that situation, which of the 7 methods you listed would you use? >> Remember, you'd get shot in the head if the method you chose told you the >> wrong answer. >> >> - I hope this clarifies what I'm after! >> >> Thanks! >> >> >> >> >> "Jerry Spivey" <jspi***@vestas-awt.com> wrote in message >> news:eyRm1%23Y1FHA.3720@TK2MSFTNGP14.phx.gbl... >> > Guadala, >> > >> > 1. Enterprise Manager >> > 2. SQL Server Service Manager >> > 3. Admin Tools --> Services --> connect to another machine >> > 4. NET >> > 5. SQL-DMO >> > 6. WMI >> > 7. WSH >> > >> > HTH >> > >> > Jerry >> > >> > "Guadala Harry" <G***@BeansAndTacos.org> wrote in message >> > news:Odxvj5Y1FHA.464@TK2MSFTNGP15.phx.gbl... >> >> Can Enterprise Manager tell us *definitively* if the SQL Server >> >> service >> >> is running/started on a particular SQL Server (where the SQL Server is >> >> not the local machine on which EM is running)? >> >> >> >> What is the most reliable way to determine if the SQL Server service >> >> is >> >> in fact up and running on any SQL server (assuming local admin access >> >> to >> >> the server is possible)? >> >> >> >> Thanks! >> >> >> > >> > >> >> >> Create a VBScript which makes an ADODB connection to the server.
Send an execute "SELECT 1 AS Test" and return the results to the recordset. If you get Test ¯¯¯¯ 1 Then your server is up. Here's a sample script, obviously there is no error handling and you can do all the nice funky COM things if you get an error or when it works (emails, fileI/O etc) Dim cnn Dim rs Dim sServerName Dim sDatabase sServerName = "MyServer" sDatabase = "Master" Set cnn = CreateObject("ADODB.Connection") cnn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=" & sDatabase & ";Data Source=" & sServerName set rs = cnn.Execute( "SELECT 1 AS TEST" ) msgbox rs.fields("Test") rs.Close cnn.Close Set rs = Nothing Set cnn = Nothing Show quote "Guadala Harry" <G***@BeansAndTacos.org> wrote in message news:uQYDRTZ1FHA.1040@TK2MSFTNGP14.phx.gbl... > Thanks Jerry and enric... But I was hoping to get your perspective on how we > can know *for sure* (thus my hilighting of *definitively*) in the OP! > > Let me put it another way. Suppose someone put a loaded gun to your head and > said they'd pull the trigger if you answered this question incorrectly: "Is > the SQL Server service running/started on our SQL Server?" > > In that situation, which of the 7 methods you listed would you use? > Remember, you'd get shot in the head if the method you chose told you the > wrong answer. > > - I hope this clarifies what I'm after! > > Thanks! > > > > > "Jerry Spivey" <jspi***@vestas-awt.com> wrote in message > news:eyRm1%23Y1FHA.3720@TK2MSFTNGP14.phx.gbl... > > Guadala, > > > > 1. Enterprise Manager > > 2. SQL Server Service Manager > > 3. Admin Tools --> Services --> connect to another machine > > 4. NET > > 5. SQL-DMO > > 6. WMI > > 7. WSH > > > > HTH > > > > Jerry > > > > "Guadala Harry" <G***@BeansAndTacos.org> wrote in message > > news:Odxvj5Y1FHA.464@TK2MSFTNGP15.phx.gbl... > >> Can Enterprise Manager tell us *definitively* if the SQL Server service > >> is running/started on a particular SQL Server (where the SQL Server is > >> not the local machine on which EM is running)? > >> > >> What is the most reliable way to determine if the SQL Server service is > >> in fact up and running on any SQL server (assuming local admin access to > >> the server is possible)? > >> > >> Thanks! > >> > > > > > > Your test could easily yield "false negatives". The ADODB connection could
fail for any number of reasons (network card is dead, network cable unplugged, etc), AND the SQL Server service could be in fact running on your server. So, in the "gun to your head" scenario, if the ADODB connection failed, you'd say "geeze - guess the SQL Server servics isn't started/running" when in fact it could be. I'd hate to see what happens next : ) Still looking for a method to get the definitive answer to the question: Is the SQL Server service running/started on our SQL Server?" Please note that I'm not asking if the SQL Server is available on the network. I'm asking about the SQL Server service, itself. Thanks! Show quote "Rebecca York" <rebecca.york {at} 2ndbyte.com> wrote in message news:4357c486$0$135$7b0f0fd3@mistral.news.newnet.co.uk... > Create a VBScript which makes an ADODB connection to the server. > Send an execute "SELECT 1 AS Test" and return the results to the > recordset. > If you get > > Test > ¯¯¯¯ > 1 > > Then your server is up. > > Here's a sample script, obviously there is no error handling and you can > do > all the nice funky COM things if you get an error or when it works > (emails, > fileI/O etc) > > > Dim cnn > Dim rs > Dim sServerName > Dim sDatabase > > sServerName = "MyServer" > sDatabase = "Master" > Set cnn = CreateObject("ADODB.Connection") > cnn.ConnectionString = "Provider=SQLOLEDB.1;Integrated > Security=SSPI;Persist > Security Info=False;Initial Catalog=" & sDatabase & ";Data Source=" & > sServerName > set rs = cnn.Execute( "SELECT 1 AS TEST" ) > msgbox rs.fields("Test") > rs.Close > cnn.Close > Set rs = Nothing > Set cnn = Nothing > > > > "Guadala Harry" <G***@BeansAndTacos.org> wrote in message > news:uQYDRTZ1FHA.1040@TK2MSFTNGP14.phx.gbl... >> Thanks Jerry and enric... But I was hoping to get your perspective on how > we >> can know *for sure* (thus my hilighting of *definitively*) in the OP! >> >> Let me put it another way. Suppose someone put a loaded gun to your head > and >> said they'd pull the trigger if you answered this question incorrectly: > "Is >> the SQL Server service running/started on our SQL Server?" >> >> In that situation, which of the 7 methods you listed would you use? >> Remember, you'd get shot in the head if the method you chose told you the >> wrong answer. >> >> - I hope this clarifies what I'm after! >> >> Thanks! >> >> >> >> >> "Jerry Spivey" <jspi***@vestas-awt.com> wrote in message >> news:eyRm1%23Y1FHA.3720@TK2MSFTNGP14.phx.gbl... >> > Guadala, >> > >> > 1. Enterprise Manager >> > 2. SQL Server Service Manager >> > 3. Admin Tools --> Services --> connect to another machine >> > 4. NET >> > 5. SQL-DMO >> > 6. WMI >> > 7. WSH >> > >> > HTH >> > >> > Jerry >> > >> > "Guadala Harry" <G***@BeansAndTacos.org> wrote in message >> > news:Odxvj5Y1FHA.464@TK2MSFTNGP15.phx.gbl... >> >> Can Enterprise Manager tell us *definitively* if the SQL Server >> >> service >> >> is running/started on a particular SQL Server (where the SQL Server is >> >> not the local machine on which EM is running)? >> >> >> >> What is the most reliable way to determine if the SQL Server service >> >> is >> >> in fact up and running on any SQL server (assuming local admin access > to >> >> the server is possible)? >> >> >> >> Thanks! >> >> >> > >> > >> >> > > yes,
-Open a DOS session -Launch NET START statement -Retrieves the list -Look for 'MSSQLSERVER' Show quote "Guadala Harry" wrote: > Your test could easily yield "false negatives". The ADODB connection could > fail for any number of reasons (network card is dead, network cable > unplugged, etc), AND the SQL Server service could be in fact running on your > server. So, in the "gun to your head" scenario, if the ADODB connection > failed, you'd say "geeze - guess the SQL Server servics isn't > started/running" when in fact it could be. > > I'd hate to see what happens next : ) > > Still looking for a method to get the definitive answer to the question: Is > the SQL Server service running/started on our SQL Server?" > > Please note that I'm not asking if the SQL Server is available on the > network. I'm asking about the SQL Server service, itself. > > Thanks! > > > > "Rebecca York" <rebecca.york {at} 2ndbyte.com> wrote in message > news:4357c486$0$135$7b0f0fd3@mistral.news.newnet.co.uk... > > Create a VBScript which makes an ADODB connection to the server. > > Send an execute "SELECT 1 AS Test" and return the results to the > > recordset. > > If you get > > > > Test > > ¯¯¯¯ > > 1 > > > > Then your server is up. > > > > Here's a sample script, obviously there is no error handling and you can > > do > > all the nice funky COM things if you get an error or when it works > > (emails, > > fileI/O etc) > > > > > > Dim cnn > > Dim rs > > Dim sServerName > > Dim sDatabase > > > > sServerName = "MyServer" > > sDatabase = "Master" > > Set cnn = CreateObject("ADODB.Connection") > > cnn.ConnectionString = "Provider=SQLOLEDB.1;Integrated > > Security=SSPI;Persist > > Security Info=False;Initial Catalog=" & sDatabase & ";Data Source=" & > > sServerName > > set rs = cnn.Execute( "SELECT 1 AS TEST" ) > > msgbox rs.fields("Test") > > rs.Close > > cnn.Close > > Set rs = Nothing > > Set cnn = Nothing > > > > > > > > "Guadala Harry" <G***@BeansAndTacos.org> wrote in message > > news:uQYDRTZ1FHA.1040@TK2MSFTNGP14.phx.gbl... > >> Thanks Jerry and enric... But I was hoping to get your perspective on how > > we > >> can know *for sure* (thus my hilighting of *definitively*) in the OP! > >> > >> Let me put it another way. Suppose someone put a loaded gun to your head > > and > >> said they'd pull the trigger if you answered this question incorrectly: > > "Is > >> the SQL Server service running/started on our SQL Server?" > >> > >> In that situation, which of the 7 methods you listed would you use? > >> Remember, you'd get shot in the head if the method you chose told you the > >> wrong answer. > >> > >> - I hope this clarifies what I'm after! > >> > >> Thanks! > >> > >> > >> > >> > >> "Jerry Spivey" <jspi***@vestas-awt.com> wrote in message > >> news:eyRm1%23Y1FHA.3720@TK2MSFTNGP14.phx.gbl... > >> > Guadala, > >> > > >> > 1. Enterprise Manager > >> > 2. SQL Server Service Manager > >> > 3. Admin Tools --> Services --> connect to another machine > >> > 4. NET > >> > 5. SQL-DMO > >> > 6. WMI > >> > 7. WSH > >> > > >> > HTH > >> > > >> > Jerry > >> > > >> > "Guadala Harry" <G***@BeansAndTacos.org> wrote in message > >> > news:Odxvj5Y1FHA.464@TK2MSFTNGP15.phx.gbl... > >> >> Can Enterprise Manager tell us *definitively* if the SQL Server > >> >> service > >> >> is running/started on a particular SQL Server (where the SQL Server is > >> >> not the local machine on which EM is running)? > >> >> > >> >> What is the most reliable way to determine if the SQL Server service > >> >> is > >> >> in fact up and running on any SQL server (assuming local admin access > > to > >> >> the server is possible)? > >> >> > >> >> Thanks! > >> >> > >> > > >> > > >> > >> > > > > > > > Guadala,
I wrote a VBScript to do it in the past. I couldn't find the script but here is a link that might prove useful: http://myitforum.techtarget.com/articles/11/view.asp?id=1194 HTH Jerry Show quote "Guadala Harry" <G***@BeansAndTacos.org> wrote in message news:u0zDGnZ1FHA.2924@TK2MSFTNGP15.phx.gbl... > Your test could easily yield "false negatives". The ADODB connection could > fail for any number of reasons (network card is dead, network cable > unplugged, etc), AND the SQL Server service could be in fact running on > your server. So, in the "gun to your head" scenario, if the ADODB > connection failed, you'd say "geeze - guess the SQL Server servics isn't > started/running" when in fact it could be. > > I'd hate to see what happens next : ) > > Still looking for a method to get the definitive answer to the question: > Is > the SQL Server service running/started on our SQL Server?" > > Please note that I'm not asking if the SQL Server is available on the > network. I'm asking about the SQL Server service, itself. > > Thanks! > > > > "Rebecca York" <rebecca.york {at} 2ndbyte.com> wrote in message > news:4357c486$0$135$7b0f0fd3@mistral.news.newnet.co.uk... >> Create a VBScript which makes an ADODB connection to the server. >> Send an execute "SELECT 1 AS Test" and return the results to the >> recordset. >> If you get >> >> Test >> ¯¯¯¯ >> 1 >> >> Then your server is up. >> >> Here's a sample script, obviously there is no error handling and you can >> do >> all the nice funky COM things if you get an error or when it works >> (emails, >> fileI/O etc) >> >> >> Dim cnn >> Dim rs >> Dim sServerName >> Dim sDatabase >> >> sServerName = "MyServer" >> sDatabase = "Master" >> Set cnn = CreateObject("ADODB.Connection") >> cnn.ConnectionString = "Provider=SQLOLEDB.1;Integrated >> Security=SSPI;Persist >> Security Info=False;Initial Catalog=" & sDatabase & ";Data Source=" & >> sServerName >> set rs = cnn.Execute( "SELECT 1 AS TEST" ) >> msgbox rs.fields("Test") >> rs.Close >> cnn.Close >> Set rs = Nothing >> Set cnn = Nothing >> >> >> >> "Guadala Harry" <G***@BeansAndTacos.org> wrote in message >> news:uQYDRTZ1FHA.1040@TK2MSFTNGP14.phx.gbl... >>> Thanks Jerry and enric... But I was hoping to get your perspective on >>> how >> we >>> can know *for sure* (thus my hilighting of *definitively*) in the OP! >>> >>> Let me put it another way. Suppose someone put a loaded gun to your head >> and >>> said they'd pull the trigger if you answered this question incorrectly: >> "Is >>> the SQL Server service running/started on our SQL Server?" >>> >>> In that situation, which of the 7 methods you listed would you use? >>> Remember, you'd get shot in the head if the method you chose told you >>> the >>> wrong answer. >>> >>> - I hope this clarifies what I'm after! >>> >>> Thanks! >>> >>> >>> >>> >>> "Jerry Spivey" <jspi***@vestas-awt.com> wrote in message >>> news:eyRm1%23Y1FHA.3720@TK2MSFTNGP14.phx.gbl... >>> > Guadala, >>> > >>> > 1. Enterprise Manager >>> > 2. SQL Server Service Manager >>> > 3. Admin Tools --> Services --> connect to another machine >>> > 4. NET >>> > 5. SQL-DMO >>> > 6. WMI >>> > 7. WSH >>> > >>> > HTH >>> > >>> > Jerry >>> > >>> > "Guadala Harry" <G***@BeansAndTacos.org> wrote in message >>> > news:Odxvj5Y1FHA.464@TK2MSFTNGP15.phx.gbl... >>> >> Can Enterprise Manager tell us *definitively* if the SQL Server >>> >> service >>> >> is running/started on a particular SQL Server (where the SQL Server >>> >> is >>> >> not the local machine on which EM is running)? >>> >> >>> >> What is the most reliable way to determine if the SQL Server service >>> >> is >>> >> in fact up and running on any SQL server (assuming local admin access >> to >>> >> the server is possible)? >>> >> >>> >> Thanks! >>> >> >>> > >>> > >>> >>> >> >> > > Sometimes MMC answer slowly in such cases and you was thinking that
everything goes fine but you was wrong. I don't know which is the best way for that,open the QA and try do 'use db'... Show quote "Guadala Harry" wrote: > Can Enterprise Manager tell us *definitively* if the SQL Server service is > running/started on a particular SQL Server (where the SQL Server is not the > local machine on which EM is running)? > > What is the most reliable way to determine if the SQL Server service is in > fact up and running on any SQL server (assuming local admin access to the > server is possible)? > > Thanks! > > > |
|||||||||||||||||||||||