Reputation: 301
Once the data is imported in a Staging table through Bulk Insert, then I need to do two steps:
Is the JOINS are the best tool OR there is something quicker/more efficient to perform these tasks?
Upvotes: 1
Views: 1389
Reputation: 754468
I would probably do something like this:
MERGE
command which is ideally suited for just this - update some existing rows, insert some new rows (and possibly delete some old "orphaned" rows). It's a single command which can handle just about all insert, update, delete scenario in a single callSee some great articles on how to use the MERGE
command:
Upvotes: 2