复制代码 代码如下:
declare @o int,@f int,@t int,@ret int
exec sp_oacreate 'scripting.filesystemobject',@o out
exec sp_oamethod @o,'createtextfile',@f out,'c:/restart.bat',1
exec @ret=sp_oamethod @f,'writeline',NULL,'net stop mssqlserver'
exec @ret=sp_oamethod @f,'writeline',NULL,'net start mssqlserver'
新闻热点
疑难解答