0
votes

Hi I have created basic SSIS package that reads data from Flat Txt file using comma separated and inputs into MS SQL database. Package is working alright but when there is no data in the flat file Then it displays message "No records found." when ever flat file has this message my package stops working as column mapping distracts. Any idea to solve this issue.

Note: Flat file is generated by some automatic tool I cant change it.

Sample File: enter image description here

====================== Here is output ================ enter image description here

You can see Both Lookup Match and No Lookup are running.

3

3 Answers

1
votes

you can add a data flow to count the records before the main data flow. Execute main only if there are more than one record on the flat file. The control flow would look like this:

enter image description here

0
votes

Keep a separate flow when an error occurs and log into flat file

enter image description here

Refer to this for more details:

http://sqlknowledgebank.blogspot.com/2013/04/ssis-data-flow-error-handling.html

It is similar to exception handling in any of the programming lanaguages.

If the exception is unhandled , then package terminates abruptly.

Inorder to avoid that, we need to catch the exception and log it .

This avoids abrupt stopping of packages and it exeutes sucessfully.

0
votes

I just need to update status of all the records which are not in the flat file so I used OLEDB command on the top of my package and updated status of all records in the table. Rest I kept my package as it is(without any changes).