Friday, March 23, 2012

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!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'...
"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 th
e
> 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
"Guadala Harry" <GMan@.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
"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" <GMan@.BeansAndTacos.org> wrote in message
> news:Odxvj5Y1FHA.464@.TK2MSFTNGP15.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" <jspivey@.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" <GMan@.BeansAndTacos.org> wrote in message
> news:Odxvj5Y1FHA.464@.TK2MSFTNGP15.phx.gbl...
>|||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 a
nd
> said they'd pull the trigger if you answered this question incorrectly: "I
s
> 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" <jspivey@.vestas-awt.com> wrote in message
> news:eyRm1%23Y1FHA.3720@.TK2MSFTNGP14.phx.gbl...
>
>|||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" <GMan@.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" <jspivey@.vestas-awt.com> wrote in message
> news:eyRm1%23Y1FHA.3720@.TK2MSFTNGP14.phx.gbl...
to
>|||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" <GMan@.BeansAndTacos.org> wrote in message
> news:uQYDRTZ1FHA.1040@.TK2MSFTNGP14.phx.gbl...
> we
> and
> "Is
> to
>|||You pointed out one of the methods I didn't think about.
Thanks!
"Enric" <Enric@.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:
>|||yes,
-Open a DOS session
-Launch NET START statement
-Retrieves the list
-Look for 'MSSQLSERVER'
"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 yo
ur
> 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: I
s
> 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...
>
>

No comments:

Post a Comment