0

Differentiate between update and insert using upsert

Hi There,

I have a requirement where I am importing records from a flat file. I need to update the record in destination SQL table if the primary key already exists else I will need to insert. There are 2 columns I need to update here. InsertDate and UpdateDate. If I Insert a record, I want the column "InsertDate" to be current Date and time, and the UpdateDate to be "01/01/1900". If its update I do not want to update the "InsertDate" column. But the UpdateDate should be currentDate and time.

How do I achive this? Do I need to build expression for this?

Thanks.

 

 

3 comments

Please sign in to leave a comment.