Any way to SQLBulkCopy “insert or update if exists”?

后端 未结 6 2057
青春惊慌失措
青春惊慌失措 2020-11-28 09:10

I need to update a very large table periodically and SQLBulkCopy is perfect for that, only that I have a 2-columns index that prevents duplicates. Is there a way to use SQLB

6条回答
  •  自闭症患者
    2020-11-28 10:05

    Another alternative would be to not use a temporary table but use a stored procedure with a table valued parameter. Pass a datatable to the sp and do the merge there.

提交回复
热议问题