Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Lookup no-match output runs even when there is no no-match output Expand / Collapse
Author
Message
Posted Tuesday, September 24, 2013 2:40 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Sunday, February 21, 2016 2:41 PM
Points: 58, Visits: 137
I have a lookup transformation that redirects rows with no matches to a no-match output. The no-match output then flows to a flat file destination that creates a csv file containing the no-match data. The problem I'm having is that the csv file is getting created even if there is no no-match output! It simply creates a blank csv file. How do I tell SSIS to create that csv file ONLY IF there is no-match data?

Thanks.
Post #1498037
Posted Tuesday, September 24, 2013 2:46 PM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Monday, May 23, 2016 6:13 AM
Points: 15,149, Visits: 13,035
I believe it will still create it anyway.
If the empty file is such a problem, you can always delete it right after the data flow. Add a row count component between the lookup and the flat file destination.
This stores the result into a variable. After the data flow, add a precedence constraint with the expression @RowCount > 0 to a file system task which will delete the file.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at SQLKover.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1498040
Posted Tuesday, September 24, 2013 2:49 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Sunday, February 21, 2016 2:41 PM
Points: 58, Visits: 137
OK, that should work. Thanks! Kind of stupid for it to perform an unnecessary task, but c'est la vie, I suppose. Thanks, again.
Post #1498044
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse