Reputation: 1460
So I can test the connection in OLE DB Source and it connects.
I can Preview the stored procedure in the OLE DB Source Editor.
The Error Output window in OLE DB Source Editor has Error and Truncation set to "Fail Component" (I tried the other choices too).
The .csv file is created and adds the column header names.
But there are no rows of data.
EDIT. Someone mentioned I should include Stored Procedure. It is very simple for testing purposes. I did replace "SELECT * FROM tblReport" with "SELECT RPT_ID, RPT_Name, RPT_Description, RPT_DBTimestamp, RPT_Active, RPT_INSDate, RPT_Note FROM tblReport". I removed all columns I wasn't using.
Here is the new text from my Output window when I run in debug mode. It still is the same and the output columns are the ones I am expecting to see in the Excel file, but Output Window says "not subsequently used" for all of them.
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.
ANOTHER EDIT: Screen-print of Control Flow with exclamation point. Hovering over the Exclamation Point it displays: "No Rows will be sent to error output(s). Configure error or truncation dispositions to redirect rows." HUH?
Upvotes: 1
Views: 587
Reputation: 19184
Make sure that the data flow leading into the target is the success data flow, not the failure data flow. It seems from your screenshot that only the failure dataflow is mapped through.
Upvotes: 1
Reputation: 61211
A destination file, error or not, will always be created regardless of whether rows are supplied.
If you need to take logic based on rows having been sent to the destination, then you'll need to create an SSIS Variable and attach it to a Row Count transformation. After the data flow task, you'll then need to take action based on the count. Some people choose to just use a Script task to inspect the file but I find it a better practice to just record my counts as I go instead of checking after the fact.
Upvotes: 0