RMu
RMu

Reputation: 869

TSQL - If Exists Update Else Insert

I have a data file with data in below format.

--removed the data and query

Thank you!

Upvotes: 0

Views: 190

Answers (1)

Richard Kemp
Richard Kemp

Reputation: 323

Reverse the order of operations - first update lookup tables, then do your import merge. You can remove your temp table, the inserts, and updates for those lookup tables. You just need a merge statement to bring in the new and/or updated rows.

Upvotes: 2

Related Questions