SQL Server啟動指令碼

luckyfriends發表於2015-04-07
@echo off
set LOG_FILE=%cd%\setup.log


echo "----------Begin to start SQL Server service-----------" >> %LOG_FILE%


net start MSSQLSERVER


net start | find "SQL Server (MSSQLSERVER)"
set EXIT_CODE=%errorlevel%
if %EXIT_CODE% neq 0 (
echo "Start MSSQLSERVER failed." >> %LOG_FILE%
goto END
)


echo "-----------Start SQL Service successfully----------" >> %LOG_FILE%


:END
exit %errorlevel%

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/14710393/viewspace-1518420/,如需轉載,請註明出處,否則將追究法律責任。

相關文章