echo "正在进行数据库安装，请稍候******"
call setup.exe



sc config MSSQLSERVER start= auto
sc failure MSSQLSERVER reset= 1 actions= restart/1000 

sc config SQLSERVERAGENT start= auto
sc failure SQLSERVERAGENT reset= 1 actions= restart/1000 

net start MSSQLSERVER
net start SQLSERVERAGENT 

copy wwsl_Data.MDF C:\MyDataMSSQL\Data
copy wwsl_log.LDF C:\MyDataMSSQL\Data 

osql -U sa -P sa -S"127.0.0.1" -Q"sp_attach_db 'wwsl' , 'C:\MyDataMSSQL\Data\wwsl_Data.MDF','C:\MyDataMSSQL\Data\wwsl_Log.LDF'"
go 

echo "数据库附加成功"
pause
exit 


