
Sometimes we need to restart a windows PC or server within or after an interval of time. We can do it easily using 'scheduled task' of windows. Here I‘ll discuss how to do this task from MS SQL SERVER. To do this we'll use a stored procedure ‘xp_cmdshell’ and an ms-dos command ‘shutdown’.
“xp_cmdshell” is a stored procedure which allows us to execute ms-dos commands from SQL Server.
Syntax
xp_cmdshell {'command_string'} [, no_output]
Arguments
command_string:...