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

ssis package to create Flat File but if no records returned write "No records to process" in flat file Expand / Collapse
Author
Message
Posted Friday, June 18, 2010 1:01 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, June 18, 2010 12:54 PM
Points: 1, Visits: 0
I am new to writing ssis packages and am having a problem with creating a flat file.

I need to create a file every hour of records updated since the last time this package was run, but if there are no records found I still need to create the file with a row containing "No records found in the process".

Have been trying use if exists (select ...) Create file else 'write no records found" in file.

any help would be greatly appreciated!

Post #939819
Posted Friday, June 18, 2010 1:14 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Monday, October 13, 2014 7:56 AM
Points: 822, Visits: 1,204
In SSIS there is a pretty easy way to do this. In the control tab first do a select count(*) in an SQL task. save the output to a variable. The next step could be one of two paths. if you double click on a trasform path then you can add an expression. If count is 0 then output flat file with text. If the count is > 1 then move to the data flow

Dan

If only I could snap my figures and have all the correct indexes apear and the buffer clean and.... Start day dream here.
Post #939825
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse