making rules in SSIS while importing data to table

2019-03-03 12:09发布

i have to import data from a csv file which contains records of users. the problem i face here is to verify that all required field is present. I need to check that all the lines contains the USER NAME(or some other values....).how do i make rule for this problem. m a newbie in SSIS. any help is appreciated. thanks in advance.

标签: ssis
1条回答
Viruses.
2楼-- · 2019-03-03 13:13

A Conditional split will do what you need here. Just write your condition for error records to have blanks in any of your requried fields (i.e. if name and password and dept are all required, then the condition:

isnull(name) || (len(trim(name))==0) || isnull(password) || (len(trim(password))==0) || isnull(dept) || (len(trim(dept))==0)

would be the condition (if you use the defaults that come up in a conditional then this condition would be Case 1) for the Error rows.

In your flow, direct the arrow for Case 1 to your ERROR_USERS table write process, and the arrow for Conditional Split Default Output to your USERS Table.

查看更多
登录 后发表回答