DECLARE @result int
EXEC @result = xp_cmdshell 'net start SQLSERVERAGENT'
IF (@result = 0)
PRINT 'Success'
ELSE
PRINT 'Failure'
EXEC @result = xp_cmdshell 'net stop SQLSERVERAGENT'
IF (@result = 0)
PRINT 'Success'
ELSE
PRINT 'Failure'
posted @ 2006-05-31 18:25 C#Hunter 阅读(253) 评论(0) 编辑
