SSIS包创建.csv文件,添加列但没有行

时间:2018-05-16 00:26:42

标签: csv visual-studio-2015 ssis

所以我可以测试OLE DB Source中的连接并连接。

我可以在OLE DB源代码编辑器中预览存储过程。

OLE DB源代码编辑器中的错误输出窗口将错误和截断设置为“失败组件”(我也尝试了其他选项)。

创建.csv文件并添加列标题名称。

但是没有数据行。

EDIT。有人提到我应该包括存储过程。它非常简单,用于测试目的。我确实将“SELECT * FROM tblReport”替换为 “SELECT RPT_ID,RPT_Name,RPT_Description,RPT_DBTimestamp,RPT_Active,RPT_INSDate,RPT_Note FROM tblReport”。我删除了所有未使用的列。

当我在调试模式下运行时,这是我的输出窗口中的新文本。它仍然是相同的,输出列是我期望在Excel文件中看到的那些,但是输出窗口对所有这些列说“没有随后使用”。

SSIS package "C:\Mail_Merge\ExportToExcel_2\Package.dtsx" starting.
Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
Warning: 0x80208385 at Data Flow Task, OLE DB Source [23]: No rows will be sent to error output(s). Configure error or truncation dispositions to redirect rows to the error output(s), or delete data flow transformations or destinations that are attached to the error output(s).
Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
Warning: 0x80208385 at Data Flow Task, OLE DB Source [23]: No rows will be sent to error output(s). Configure error or truncation dispositions to redirect rows to the error output(s), or delete data flow transformations or destinations that are attached to the error output(s).
Warning: 0x80047076 at Data Flow Task, SSIS.Pipeline: The output column "RPT_ID" (35) on output "OLE DB Source Output" (34) and component "OLE DB Source" (23) is not subsequently used in the Data Flow task. Removing this unused output column can increase Data Flow task performance.
Warning: 0x80047076 at Data Flow Task, SSIS.Pipeline: The output column "RPT_Name" (36) on output "OLE DB Source Output" (34) and component "OLE DB Source" (23) is not subsequently used in the Data Flow task. Removing this unused output column can increase Data Flow task performance.
Warning: 0x80047076 at Data Flow Task, SSIS.Pipeline: The output column "RPT_Description" (37) on output "OLE DB Source Output" (34) and component "OLE DB Source" (23) is not subsequently used in the Data Flow task. Removing this unused output column can increase Data Flow task performance.
Warning: 0x80047076 at Data Flow Task, SSIS.Pipeline: The output column "RPT_DBTimestamp" (38) on output "OLE DB Source Output" (34) and component "OLE DB Source" (23) is not subsequently used in the Data Flow task. Removing this unused output column can increase Data Flow task performance.
Warning: 0x80047076 at Data Flow Task, SSIS.Pipeline: The output column "RPT_Active" (39) on output "OLE DB Source Output" (34) and component "OLE DB Source" (23) is not subsequently used in the Data Flow task. Removing this unused output column can increase Data Flow task performance.
Warning: 0x80047076 at Data Flow Task, SSIS.Pipeline: The output column "RPT_INSDate" (40) on output "OLE DB Source Output" (34) and component "OLE DB Source" (23) is not subsequently used in the Data Flow task. Removing this unused output column can increase Data Flow task performance.
Warning: 0x80047076 at Data Flow Task, SSIS.Pipeline: The output column "RPT_Note" (41) on output "OLE DB Source Output" (34) and component "OLE DB Source" (23) is not subsequently used in the Data Flow task. Removing this unused output column can increase Data Flow task performance.
Information: 0x40043006 at Data Flow Task, SSIS.Pipeline: Prepare for Execute phase is beginning.
Information: 0x40043007 at Data Flow Task, SSIS.Pipeline: Pre-Execute phase is beginning.
Information: 0x402090DC at Data Flow Task, Flat File Destination [2]: The processing of file "C:\SSIS\testSSIS.csv" has started.
Information: 0x4004300C at Data Flow Task, SSIS.Pipeline: Execute phase is beginning.
Information: 0x40043008 at Data Flow Task, SSIS.Pipeline: Post Execute phase is beginning.
Information: 0x402090DD at Data Flow Task, Flat File Destination [2]: The processing of file "C:\SSIS\testSSIS.csv" has ended.
Information: 0x4004300B at Data Flow Task, SSIS.Pipeline: "Flat File Destination" wrote 0 rows.
Information: 0x40043009 at Data Flow Task, SSIS.Pipeline: Cleanup phase is beginning.
SSIS package "C:\Mail_Merge\ExportToExcel_2\Package.dtsx" finished: Success.

另一个编辑:带感叹号的控制流的屏幕打印。 将鼠标悬停在感叹号上会显示: “没有行将被发送到错误输出。配置错误或截断处置以重定向行。” HUH?

enter image description here

2 个答案:

答案 0 :(得分:1)

确保通向目标的数据流是成功数据流,而不是故障数据流。从您的屏幕截图中可以看出,只有故障数据流才会被映射。

答案 1 :(得分:0)

无论是否提供行,都将始终创建目标文件(无论是否出现错误)。

如果需要根据已发送到目标的行获取逻辑,则需要创建SSIS变量并将其附加到行计数转换。在数据流任务之后,您需要根据计数采取措施。有些人选择只使用脚本任务来检查文件,但我觉得更好的做法就是记录我的计数而不是事后检查。