Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, November 5, 2013 10:30 AM
Points: 44, Visits: 99
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


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 9:28 AM
Points: 13,570, Visits: 10,447
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 LessThanDot.

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

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, November 5, 2013 10:30 AM
Points: 44, Visits: 99
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