2006年5月31日

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) 编辑


posts - 9, comments - 12, trackbacks - 0, articles - 0

Copyright © C#Hunter