April 19, 2010 at 5:08 am
Hi,
is there any posibilites to find out the sql server services start up method through T-Sql command ?
Thanks in Advance.
April 19, 2010 at 5:32 am
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?
April 19, 2010 at 5:43 am
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.
April 19, 2010 at 5:51 am
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?
April 19, 2010 at 5:56 am
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.
April 19, 2010 at 6:02 am
Am sorry buddy, i cant be of much help to u in this.. lets wait for our SSC bigwigs to attend this...
Cheers!!
April 19, 2010 at 6:24 am
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
April 19, 2010 at 6:58 am
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 ?
April 19, 2010 at 7:19 am
April 19, 2010 at 7:38 am
joeroshan (4/19/2010)
No
thanks 🙂
April 23, 2010 at 8:07 am
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