Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 SSIS handling empty files

Author  Topic 

konark
Yak Posting Veteran

60 Posts

Posted - 2009-09-04 : 13:59:05
I have a data flow task .

OLE DB Source - using sql query
output to
flat file Destination.

My requirement is "Generate the file , only when there is data from the query.Else Do not generate"

Can i do that ?


Chandragupta Mourya

under2811
Constraint Violating Yak Guru

366 Posts

Posted - 2009-09-07 : 04:44:49
May be help you out :)

http://bi-polar23.blogspot.com/2008/02/dynamic-flat-file-destinations.html

I have added one more row to SourceData table "Admin" and insert blank record (FirstName) in it and change Sql query to

SELECT DISTINCT * FROM SourceData
where FirstName <> ''
Go to Top of Page

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2009-09-07 : 13:38:21
I'd suggest you get the rowcount in a variable.
Then set the precedence constraint expression to be @[User::varRowCount] > 0 and success to the Data flow task that extracts the data to a file.

Go to Top of Page
   

- Advertisement -