2016-03-22
@rem 2016/03/22 @rem SQL Server 2014 @rem http://manage.windowsazure.com/ rem -------------------------------------------------------------------------------- REM 取得日期 FOR /F "tokens=1-4 delims=/ " %%a IN ("%date%") DO ( rem SET _MyDate=%%a%%b%%c%%d SET MyDate=%%a-%%b-%%c ) FOR /F "tokens=1-4 delims=: " %%a IN ("%time%") DO ( SET MyTime=%%a-%%b-%%c SET Hour=%%a SET Minute=%%b SET Second=%%c SET Second=%Time:~6,2% ) echo Hour=%Hour% echo Minute=%Minute% echo Second=%Second% rem 測試環境 : Windows 10 rem 小時不會自動補0,只好另外處理,但分會自動補0 IF %Hour:~0,1% == 0 ( SET Hour=%Hour% echo "1" ) ELSE ( SET Hour=0%Hour% echo "2" ) echo Hour=%Hour% SET MyDateTime=%MyDate%-%MyTime% SET MyDateTime2=%MyDate%-%Hour%-%Minute%-%Second% REM 顯示去掉分隔符號後的結果 echo %MyDate% echo %MyTime% echo %MyDateTime% echo %MyDateTime2% SET DBFilename=D:\NCCSTWebAzureDB-%MyDateTime2%.bacpac rem -------------------------------------------------------------------------------- "C:\Program Files (x86)\Microsoft SQL Server\120\DAC\bin\SqlPackage.exe" /a:Export /ssn:"主機名稱.database.windows.net" /sdn:資料庫名稱 /su:帳號 /sp:密碼 /tf:%DBFilename% |
不知是否因為測試太多次 or 其他原因,出現
*** 在接收來自伺服器的要求時發生傳輸層級的錯誤。 (provider: TCP Provider, error: 0 - 遠端主機已強制關閉一個現存的連線。)
(完)
沒有留言:
張貼留言