在做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”選項。
今天得到的一個解決方法是:
在用sqlserver導入 導出向導時,勾選“Enable Identity Insert”選項。導完保存ssis包,如果出現Code Page的錯誤。那么進行下一步:
右擊保存的ssis包-編輯,出現數據流窗口,右鍵點擊OLE DB Source控件,點擊Show Advanced Editor…
在彈出的窗口中選擇Component Properties,然后將在這里將屬性AlwaysUseDefaultCodePage設置為true,DefaultCodePage也應為936。
這樣兩個錯誤都解決了。