sqlserver導入數據時常出現的錯誤解答


在做SSIS項目的Data Coversion時,經常會遇到類似如下兩個問題:

 1.Validating (Error)

       Messages

         * Error 0xc02020f4: Data Flow Task 1: The column "xxxx" cannot be processed because more than one code page (936 and 1252) are specified for it.

          (SQL Server Import and Export Wizard)

        * Error 0xc02020f4: Data Flow Task 1: The column "xxxx" cannot be processed because more than one code page (936 and 1252) are specified for it.

          (SQL Server Import and Export Wizard)

    解決:檢查你源數據庫和目標數據庫的排序規則是否不一致,如果Code Page不一致,就會出現大量上面錯誤。

  2:在驗證時出現下面錯誤信息

- Validating (Error)

            Messages

                  * Error 0xc0202049: Data Flow Task 1: Failure inserting into the read-only column "xxxxx".

                  (SQL Server Import and Export Wizard)

                  * Error 0xc0202045: Data Flow Task 1: Column metadata validation failed.

                  (SQL Server Import and Export Wizard)

    解決:出現這個錯誤,是因為這一列是自動增長,需要在”Edite Mappings" 選項里面勾選“Enable Identity Insert”選項。

      MSDN對於Code Page的解釋是:對於字符和 Unicode 數據,代碼頁是代表特定字母、數字或符號的位模式的定義(例如 0x20 代表空格,0x74 代表字符“t”)。某些數據類型為每個字符使用一個字節;每個字節的位模式可以是 256 種不同位模式之一。

今天得到的一個解決方法是:

在用sqlserver導入 導出向導時,勾選“Enable Identity Insert”選項。導完保存ssis包,如果出現Code Page的錯誤。那么進行下一步:

右擊保存的ssis包-編輯,出現數據流窗口,右鍵點擊OLE DB Source控件,點擊Show Advanced Editor…

在彈出的窗口中選擇Component Properties,然后將在這里將屬性AlwaysUseDefaultCodePage設置為true,DefaultCodePage也應為936。

這樣兩個錯誤都解決了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM