Ignore records with null field when copying from one table to another using SSIS
Is it possible in a SSIS to ignore records that have a null field? For example i want to copy data from one database table to another, however Table A has some rubbish data in it and ha开发者_JAVA百科s some fields with nulls in them. I only want to copy records to Table B, that do not have any null fields.
Here are the two possible options that might work for you.
You can use a query to read the data from the source table and filter out the records that have NULL value using WHERE clause. You can also have this query in a stored procedure and use the stored procedure as your data source.
If the source in the SSIS package is reading from a table, you can use a Conditional Split transformation to separate the NULL and non-NULL records and use only the non-NULL records further down the pipeline.
I feel that the first option is easier because it gives you more control and it is also easier to maintain.
精彩评论