我在这个批处理文件中做错了什么?

时间:2016-07-05 21:57:45

标签: sql-server batch-file osql

当我运行下面的批处理文件代码时,它认为服务器地址是' dbuser'而数据库是“假”'

我做错了什么?

以下是代码:

@echo off
set toolspath=C:\Program Files (x86)\Folder\Application
Set ApplicationServer=00.0.00.000
Set ApplicationDatabase=dbApplication
Set ApplicationUser=dbuser
Set ApplicationPassword=abcdefg
Set ApplicationUpgradeFromPre12_5=False


REM echo "Attaching dbApplication .. "
REM osql -S %ApplicationServer% -U %ApplicationUser% -P    %ApplicationPassword% -i %ApplicationScriptsPath%\AttachApplicationDatabase.sql
REM osql -S %ApplicationServer% -U %ApplicationUser% -P %ApplicationPassword% -i %ApplicationScriptsPath%\SetDBVersion.sql
REM echo "Done."


call ApplicationUpgradeScripts.bat %%2 %ApplicationUser% %ApplicationPassword% %ApplicationDatabase% %ApplicationUpgradeFromPre12_5%
@if ERRORLEVEL 1 goto ERRORSEXIT 

@Echo %ApplicationDatabase% Database Updated Successfully.

goto FINISH


:ERRORSEXIT 
@Echo Error: Database Excecuted With Error. To Find out Exact Error see file    ErrorLog.log
exit /B 1
goto ENDBUILD 

:FINISH 
@Echo All Databases Excecuted Successfully. 
exit 0

:ENDBUILD 
pause

0 个答案:

没有答案