sql - SSIS: How to check if a record DOESN'T exist in flat file but exists on the database -


i working on preparing ssis job importing .cvsv file ole db destination (sql database). going these files on daily basis. .csv file contains records of doctors. each row represents doctor. below image shows how able successfully. no problems upto point. enter image description here

here's need with:

if doctor no longer active going same .csv file without record of him/her. how check see if record not in .csv file exists in sql database? need update doctor row in sql database , update isactive field row false.

naturally, psuedo-code.

select doctorid drtable not exists (select doctorid csvtable csvtable.doctorid=drtable)) 

you update in same statement using:

update drtable  set isactive = 0  doctorid in (   select doctorid     drtable     not exists (select doctorid csvtable csvtable.doctorid=drtable))) 

Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -