[MSSQL] SQL Server Agent 執行 SSIS 常見問題
續 《SQL Server Agent 排程自動化更新不同 Server 上的資料表》,分享排程執行後,常見問題及解決方式
- 無法載入指令碼工作
Code: 0x00000001
Description: Cannot load script for execution. End Error
查許多文章的解法,如: SSIS script task fails on server with error “Cannot load script for execution”,皆提到重新設定部屬目標版本 Change the target version in the project properties。這篇曾提到沒有用 Integration Services Project 專案開啟封裝檔,可能會影響到功能設定。這就是其中一項,一開始我怎麼找,都找不到設定部屬目標版本的地方。直到用 Integration Services Project 專案開啟封裝檔,才在專案的 SSIS 屬性頁找到。
- 解密受保護的 XML 節點失敗
Code: 0xC0016016
Description: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.
將封裝檔以 XML 格式開啟,找到 DTS:Password ,我看到的是一串雜湊碼。接著再回到 VS 環境,查看專案的屬性,起初安全性 ProtectionLevel 設定的地方為 EncryptSensitiveWithUserKey,將其改成 EncryptSensitiveWithPassword,並在 PackagePassword 設定密碼。
接著更新排程作業步驟屬性裡,封裝的地方,會跳出封裝密碼視窗,輸入在 PackagePassword 設定的密碼,重啟排程就可以排除問題。