SSIS 包创建 .csv 文件,添加列但不添加行
SSIS package creates .csv file, adds columns but no rows
所以我可以在 OLE DB 源中测试连接并且它连接了。
我可以在 OLE DB 源代码编辑器中预览存储过程。
OLE DB 源代码编辑器中的错误输出 window 有错误并且 T运行cation 设置为 "Fail Component"(我也尝试了其他选择)。
.csv 文件已创建并添加列 header 名称。
但是没有数据行
编辑。有人提到我应该包括存储过程。出于测试目的,它非常简单。我确实将 "SELECT * FROM tblReport" 替换为
"SELECT RPT_ID, RPT_Name, RPT_Description, RPT_DBTimestamp, RPT_Active, RPT_INSDate, RPT_Note FROM tblReport"。我删除了所有未使用的列。
这是我 运行 在调试模式下输出 window 的新文本。它仍然是相同的,输出列是我期望在 Excel 文件中看到的列,但是输出 Window 对所有这些列表示 "not subsequently used"。
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.
另一项编辑:Screen-print 带有感叹号的控制流。
将鼠标悬停在它显示的感叹号上:
"No Rows will be sent to error output(s). Configure error or truncation dispositions to redirect rows."嗯?
无论是否提供行,都将始终创建目标文件,无论是否有错。
如果您需要根据已发送到目标的行获取逻辑,则需要创建一个 SSIS 变量并将其附加到行计数转换。完成数据流任务后,您需要根据计数采取措施。有些人选择只使用脚本任务来检查文件,但我发现更好的做法是边走边记录我的计数,而不是事后检查。
确保进入目标的数据流是成功数据流,而不是失败数据流。从您的屏幕截图看来,只有故障数据流被映射。
所以我可以在 OLE DB 源中测试连接并且它连接了。
我可以在 OLE DB 源代码编辑器中预览存储过程。
OLE DB 源代码编辑器中的错误输出 window 有错误并且 T运行cation 设置为 "Fail Component"(我也尝试了其他选择)。
.csv 文件已创建并添加列 header 名称。
但是没有数据行
编辑。有人提到我应该包括存储过程。出于测试目的,它非常简单。我确实将 "SELECT * FROM tblReport" 替换为 "SELECT RPT_ID, RPT_Name, RPT_Description, RPT_DBTimestamp, RPT_Active, RPT_INSDate, RPT_Note FROM tblReport"。我删除了所有未使用的列。
这是我 运行 在调试模式下输出 window 的新文本。它仍然是相同的,输出列是我期望在 Excel 文件中看到的列,但是输出 Window 对所有这些列表示 "not subsequently used"。
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.
另一项编辑:Screen-print 带有感叹号的控制流。 将鼠标悬停在它显示的感叹号上: "No Rows will be sent to error output(s). Configure error or truncation dispositions to redirect rows."嗯?
无论是否提供行,都将始终创建目标文件,无论是否有错。
如果您需要根据已发送到目标的行获取逻辑,则需要创建一个 SSIS 变量并将其附加到行计数转换。完成数据流任务后,您需要根据计数采取措施。有些人选择只使用脚本任务来检查文件,但我发现更好的做法是边走边记录我的计数,而不是事后检查。
确保进入目标的数据流是成功数据流,而不是失败数据流。从您的屏幕截图看来,只有故障数据流被映射。