February 28, 2008 at 12:47 pm
I am processing records in a SQL 2005 database and then writing certain ones back out to a flat file using an ole db source to a flat file destination. If there are not any records returned from the source the file is created anyway. Is there a way in SSIS to tell it not to create the file if no records exist? Thank you for any help. I am new to SSIS and have been searching the web for this and cannot find anything.
February 28, 2008 at 2:46 pm
Usually people want to have the file no matter if there is data coming or not. But I can understand your requirement.
But before that, I have another question, let say today you have some data, so you have it in the destination. But then, lets say tomorrow you dont have any new data, what will happen to the destination now which contains previous day's data?
[font="Verdana"]Imagination is more important than knowledge-Albert Einstein[/font]
February 29, 2008 at 5:52 am
We have another process that runs and picks up the files. The problem is this process will blow up if an empty file is created. We are trying to get our vendor to change this process but that will take some time. I was hoping there was somthing I could do on the SSIS side to not even create the flat file if there are not any records.
February 29, 2008 at 7:02 am
Okay in that case, you can do this.
1. In dataflow do all your part to behave like if there are any data coming.
2. But in the Control flow, do a logic in Execute SQL Task to tell if there nothing for that day.
3. Drag and drop the file system task to delete the content of directory.
But I still don't know how you are about to save previous day data if you do this. They don't want historical data at all? That's why they are not worried about this?I would go with overwrite the files everyday if they want an up to date data!
Hope this helps.
[font="Verdana"]Imagination is more important than knowledge-Albert Einstein[/font]
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply