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'

相关文章:

  • 2021-10-02
  • 2022-12-23
  • 2021-11-01
  • 2022-12-23
  • 2021-08-06
  • 2022-12-23
  • 2021-08-23
  • 2021-12-30
猜你喜欢
  • 2022-01-01
  • 2022-12-23
  • 2021-08-23
  • 2022-01-06
  • 2021-10-28
  • 2021-06-18
相关资源
相似解决方案