● 請先完成 SQL Server Express 定時備份
● 建立 PowerShell 檔案,內容如下:
sqlcmd -S .\SQLEXPRESS -E -Q "EXEC sp_BackupDatabases @backupLocation='E:\', @databaseName='DB_Name', @backupType='F'"
● 存檔,檔名是 backup_database.ps1 (附檔名必須是ps1)
● 工作排程器 → 動作 → 新增
● 程式或指令碼,填入 powershell
● 新增引數,填入以下文字:
-ExecutionPolicy Bypass -File "C:\Users\Jimmy\Desktop\backup_database.ps1"
Hi there! This post could not be written any better!
Going through this post reminds me of my previous roommate!
He continually kept talking about this. I am going to send this
article to him. Fairly certain he’ll have a great read. Thanks for sharing!