-2

What is the more effective way to implement bulk update from a collection? I implemented the insert with SqlBulkCopy but how can I implement Bulk Update?

Thanks

L. Kvri
  • 1,456
  • 4
  • 23
  • 41

1 Answers1

0

There is no such thing as a 'bulk update' - all update statements in SQL run 'in bulk'.

You would just use SqlBulkInsert as you have to insert to a staging table, then run the update from there, like

UPDATE [live]
  SET [SomeColumn] = [staging].[SomeColumn]
FROM [dbo].[TheTable] live
INNER JOIN [dbo].[TheTableStaging] staging
  ON live.[SomeKey] = staging.[SomeKey]
Milney
  • 6,253
  • 2
  • 19
  • 33