October 2, 2008 at 10:16 am
Hi,
I created a simple package which retrive data to a flatfile and uploads file to SFTP location.
This package retrieves data from sql server query.
One day it will contain data and other day it may not have data. This is fine.
I want to contraol this so that file should be generated until there is atleast ROW of data.
Now even though there is no data, still file is sending to SFTP location with only column names. I do not want this.
I appreciate your quick help.
Thanks in Advance.
October 2, 2008 at 11:34 am
At the beginning of the package, put an Execute SQL step that checks for rows. If it finds rows to export, have it return a 1, if it doesn't, have it return a 0. Assign that to a variable.
Put the green arrow (precedence constraint) from that to the export, and go to the properties on the arrow. Set it to Condition AND Expression, and set the expression to "Variable == 1". (Or whatever name your gave the variable.)
That way, it will only run the next step, the export, if there are rows.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply