0

I am using a DFT that pulls the records from DB where ErrorInd is 1. I want the error records to be placed in a flat file, and if there are no errors I do not want to create any file.

To to this, first I created a variable @RecordCount and this variable is getting assigned using Execute Sql Task right before DFT, then in DFT created oledb source and used query to pull records. Once then I am using conditional split. In conditional split I am giving a condition like @RecordCount > 0, then mapping case1 to Flat file destination.

Somehow, the case is not working, even if the variable @RecordCount is 0 the flat file is getting generated and I do not want to do that.

What I understood is, whatever the case is, the condition is working but flat file will get generate?. How do I handle it? would there be any work around?

PS: the flat file is getting generated dynamically

Harsha
  • 113
  • 9

1 Answers1

0

I would add an Expression to set the Disable property on the Data Flow, e.g.

@[User::RecordCount] == 0

I would remove the Conditional Split transformation - once the Data Flow has started, it is too late to avoid creating the output flat file.

Mike Honey
  • 14,523
  • 1
  • 24
  • 40
  • That might not be correct way to disable the DFT as it is within for loop. Anyways, I am handling this scenarios in Script Task, by reading the file and if empty, delete from the folder. Thanks for your reply – Harsha Dec 07 '15 at 16:44