Services

  • Hi,

    is there any posibilites to find out the sql server services start up method through T-Sql command ?

    Thanks in Advance.

  • Buddy, dint get ur question fully... u mean, u now need a way to find out if the SQLSERVER and its entourage services are running using T-SQL code, am i right?

  • COldCoffee (4/19/2010)


    Buddy, dint get ur question fully... u mean, u now need a way to find out if the SQLSERVER and its entourage services are running using T-SQL code, am i right?

    Hi,

    Thanks for you reply.. My question is want to find out the sql server services start up methods(Automatic,Manual,Disabled) by T-Sql . hope you can understand now. I want set sql agent job to trigger alert if someone change the Sql server service method as Manual from automatic.

  • Oh i get it... hmmm... i dont think we have a way to check that out using T-SQL, BUT I MAY BE WRONG.. probably with little bit of a helping hand from C#, we can accomplish that.. but , btw, just out of curiosity, why do u need that to be done?? Wont the system admins take care of that?

  • COldCoffee (4/19/2010)


    Oh i get it... hmmm... i dont think we have a way to check that out using T-SQL, BUT I MAY BE WRONG.. probably with little bit of a helping hand from C#, we can accomplish that.. but , btw, just out of curiosity, why do u need that to be done?? Wont the system admins take care of that?

    Thanks for your reply... Want ensure that all the services are running on the automatic mode to avoid the manual Intervention when windows system rebooting.

  • Am sorry buddy, i cant be of much help to u in this.. lets wait for our SSC bigwigs to attend this...

    Cheers!!

  • You can use xp_cmdshell.

    xp_cmdshell 'sc qc mssqlserver'

    Note: xp_cmdshell makes your server vurnerable to threats. Disable it once you are done

    ----------------------------------------------------------------------------------------------------------------------------------------------------
    Roshan Joe

    Jeff Moden -Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • joeroshan (4/19/2010)


    You can use xp_cmdshell.

    xp_cmdshell 'sc qc mssqlserver'

    Note: xp_cmdshell makes your server vurnerable to threats. Disable it once you are done

    Thanks your reply...

    we can read from following command as well

    exec master..xp_regread 'HKEY_LOCAL_MACHINE' ,'SYSTEM\ControlSet001Services\MSSQLSERVER','start'

    -- 2 Automatic

    -- 3 Manual

    -- 4 Disabled

    we can read from registry as well.

    Will it make server vulnerable to threats ?

  • No

    ----------------------------------------------------------------------------------------------------------------------------------------------------
    Roshan Joe

    Jeff Moden -Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • joeroshan (4/19/2010)


    No

    thanks 🙂

  • Hi,

    Is there any possibilities to get the server running status(Running or Stopped) from the registry?

    Thanks in Advance.

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply