当我限制来自 CSV 源的列数时,如何确保 SSIS 识别 {CL}{RF} 的新位置?
How can I ensure SSIS recognizes the new position of the {CL}{RF} when I limit the number of columns from a CSV Source?
当发现问题与 无关时,这变成了一个两部分的问题。
我的环境是 SSIS 2012,由 Visual Studio 提供支持。
来源: CSV 文件分隔符集: None。但是,CSV 将在包含列分隔符的列中插入 {"}。
Columns: Year,Lg,Tm,W,L,T,Div Finish,Playoffs,PF,PA,PD,Coaches,AV,Passer,Rusher,Receiver,Pts,Yds,Pts,Yds,T/G,Pts±,Yds±,out of,MoV,SoS,SRS,OSRS,DSRS
Columns kept in extraction: Year,Lg,Tm,W,L,T,Div Finish,Playoffs
Column Delimiter: Comma{,}
ColumnType: Delimited
DataType: string [DT_STR]
OutputColumnWidth: 100 (modified)
TextQualified: True
平面文件连接管理器属性还包含:
Expressions - ConnectionString : @[User::File_Name]
我的目标 table 纯粹是在 SSIS
中处理的加载 table。
目标 Table(按照设计,错误永远不会到达此文件)
[schema].[table]
Team_ID VARCHAR(100)
Durable_Key VARCHAR(100)
Year VARCHAR(100)
Lg VARCHAR(100)
Tm VARCHAR(100)
W VARCHAR(100)
L VARCHAR(100)
T VARCHAR(100)
[Div Finish] VARCHAR(100)
Playoffs VARCHAR(100)
请注意,这些文件最终成为唯一能够准确定义 NFL 认可的球队关系的文件,甚至可以追溯到 1921 年球队进入 NFL 之前。
这组行在 SSIS
中被接受table
1929,NFL,Buffalo Bisons,1,7,1,10th of 12,,48,142,-94,Jolley,,,,,9,1,10,1,1,10,1,12,-10.4,0.4,-10,-4.8,-5.2
1927,NFL,Buffalo Bisons,0,5,0,12th of 12,,8,123,-115,Batterson,,,,,12,1,12,1,1,12,1,12,-23,0.5,-22.5,-6.8,-15.7
这些行是立即失败的行
1944,NFL,Brooklyn Tigers,0,10,0,5th of 5,,69,166,-97,KubaleCawthonBridges,,McGibbony,Manders,Masterson,10,9,5,5,9,8,8,11,-9.7,3.1,-6.6,-9.4,2.8
1943,NFL,Brooklyn Dodgers,2,8,0,4th of 5,,65,234,-169,Cawthon,,McAdams,Manders,Martin,8,8,7,8,6,8,8,10,-16.9,2.1,-14.8,-12.7,-2.1
[Flat File Source [14]] Error: An error occurred while processing file "[File_Path]" on data row 2.
- 除了使用
FOREACHLOOP
. 所必需的以外,所有其他设置都保留为默认设置
- 代码页设置从未更改 (1252)
- 在
FOREACHLOOP
Collection
中使用的唯一表达式是 Name
,因此它应该不会对数据产生影响。
这是完整的错误信息:
[NFL_Team_List [52]] Error: Data conversion failed. The data conversion for column "Playoffs" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".
[NFL_Team_List [52]] Error: The "NFL_Team_List.Outputs[Flat File Source Output].Columns[Playoffs]" failed because truncation occurred, and the truncation row disposition on "NFL_Team_List.Outputs[Flat File Source Output].Columns[Playoffs]" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
[NFL_Team_List [52]] Error: An error occurred while processing file "[DESTINATION_PATH]/[FILE_NAME].csv" on data row 2.
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on NFL_Team_List returned error code 0xC0202092. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.
虽然我认为问题与兼容性有关,也与文本定界符的设置有关,但似乎并非如此。 SSIS 坚持读取到 {CL}{RF} 位置的末尾,我似乎无法让它识别不同的列是行的末尾。
结果是 table 中的最后一列吸收了多余的字符串,当然也超出了列限制。
- 那么如何确保 SSIS
识别 {CL}{RF}
的新位置而不吸收列中的其余数据?
很高兴我们弄清楚了我们的困惑所在。平面文件连接只是数据源的定义。因此,这里不是限制您要使用哪些列和不使用哪些列的地方。在数据流任务的源组件中,您可以限制列,但可以从高级编辑器的输出中删除它们。您也可以忽略不需要的列。
当发现问题与
我的环境是 SSIS 2012,由 Visual Studio 提供支持。
来源: CSV 文件分隔符集: None。但是,CSV 将在包含列分隔符的列中插入 {"}。
Columns: Year,Lg,Tm,W,L,T,Div Finish,Playoffs,PF,PA,PD,Coaches,AV,Passer,Rusher,Receiver,Pts,Yds,Pts,Yds,T/G,Pts±,Yds±,out of,MoV,SoS,SRS,OSRS,DSRS
Columns kept in extraction: Year,Lg,Tm,W,L,T,Div Finish,Playoffs
Column Delimiter: Comma{,}
ColumnType: Delimited
DataType: string [DT_STR]
OutputColumnWidth: 100 (modified)
TextQualified: True
平面文件连接管理器属性还包含:
Expressions - ConnectionString : @[User::File_Name]
我的目标 table 纯粹是在 SSIS
中处理的加载 table。
目标 Table(按照设计,错误永远不会到达此文件)
[schema].[table]
Team_ID VARCHAR(100)
Durable_Key VARCHAR(100)
Year VARCHAR(100)
Lg VARCHAR(100)
Tm VARCHAR(100)
W VARCHAR(100)
L VARCHAR(100)
T VARCHAR(100)
[Div Finish] VARCHAR(100)
Playoffs VARCHAR(100)
请注意,这些文件最终成为唯一能够准确定义 NFL 认可的球队关系的文件,甚至可以追溯到 1921 年球队进入 NFL 之前。
这组行在 SSIS
中被接受table1929,NFL,Buffalo Bisons,1,7,1,10th of 12,,48,142,-94,Jolley,,,,,9,1,10,1,1,10,1,12,-10.4,0.4,-10,-4.8,-5.2
1927,NFL,Buffalo Bisons,0,5,0,12th of 12,,8,123,-115,Batterson,,,,,12,1,12,1,1,12,1,12,-23,0.5,-22.5,-6.8,-15.7
这些行是立即失败的行
1944,NFL,Brooklyn Tigers,0,10,0,5th of 5,,69,166,-97,KubaleCawthonBridges,,McGibbony,Manders,Masterson,10,9,5,5,9,8,8,11,-9.7,3.1,-6.6,-9.4,2.8
1943,NFL,Brooklyn Dodgers,2,8,0,4th of 5,,65,234,-169,Cawthon,,McAdams,Manders,Martin,8,8,7,8,6,8,8,10,-16.9,2.1,-14.8,-12.7,-2.1
[Flat File Source [14]] Error: An error occurred while processing file "[File_Path]" on data row 2.
- 除了使用
FOREACHLOOP
. 所必需的以外,所有其他设置都保留为默认设置
- 代码页设置从未更改 (1252)
- 在
FOREACHLOOP
Collection
中使用的唯一表达式是Name
,因此它应该不会对数据产生影响。
这是完整的错误信息:
[NFL_Team_List [52]] Error: Data conversion failed. The data conversion for column "Playoffs" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".
[NFL_Team_List [52]] Error: The "NFL_Team_List.Outputs[Flat File Source Output].Columns[Playoffs]" failed because truncation occurred, and the truncation row disposition on "NFL_Team_List.Outputs[Flat File Source Output].Columns[Playoffs]" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
[NFL_Team_List [52]] Error: An error occurred while processing file "[DESTINATION_PATH]/[FILE_NAME].csv" on data row 2.
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on NFL_Team_List returned error code 0xC0202092. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.
虽然我认为问题与兼容性有关,也与文本定界符的设置有关,但似乎并非如此。 SSIS 坚持读取到 {CL}{RF} 位置的末尾,我似乎无法让它识别不同的列是行的末尾。
结果是 table 中的最后一列吸收了多余的字符串,当然也超出了列限制。
- 那么如何确保 SSIS
识别 {CL}{RF}
的新位置而不吸收列中的其余数据?
很高兴我们弄清楚了我们的困惑所在。平面文件连接只是数据源的定义。因此,这里不是限制您要使用哪些列和不使用哪些列的地方。在数据流任务的源组件中,您可以限制列,但可以从高级编辑器的输出中删除它们。您也可以忽略不需要的列。