# EF Core: choosing between BulkMerge and manual SQL upserts

Canonical source : [EF Core: choosing between BulkMerge and manual SQL upserts](<https://sebastien.rigaux.be/en/tech-watch/links/ef-core-choosing-between-bulkmerge-and-manual-sql-upserts>)

EF Core has no native upsert operation. This article compares manual processing, SQL Server `MERGE`, and BulkMerge for inserting or updating batches, including parent-child graphs. It lays out the trade-offs in dependencies, portability, and maintenance, alongside benchmarks tied to their test environment.

With BulkMerge, the match key is critical: without an explicit business key, incoming records can be treated as new rows. Column-selection options can also preserve manually curated fields, while `IncludeGraph` propagates foreign keys from parents to children.

- Selected on : 2026-11-20

- Resource publication : 2026-06-18

- Entry updated : 2026-11-20T03:21:55+0000

- Format : Article

- Source language : EN

- Credit : Chris Woody Woodruff

- Found via : [C\# Digest](<https://csharpdigest.net/>)

Original resource : [EF Core: choosing between BulkMerge and manual SQL upserts](<https://woodruff.dev/blog/bulkmerge-upsert-in-ef-core-how-to-insert-or-update-without-the-headache/>)

Tags : [Entity Framework Core](<https://sebastien.rigaux.be/en/tech-watch/tags/entity-framework-core>) · [SQL Server](<https://sebastien.rigaux.be/en/tech-watch/tags/sql-server>)

Available versions : [Français](<https://sebastien.rigaux.be/veille/liens/ef-core-choisir-entre-bulkmerge-et-un-upsert-sql-manuel>) · [English](<https://sebastien.rigaux.be/en/tech-watch/links/ef-core-choosing-between-bulkmerge-and-manual-sql-upserts>)

[Back to tech watch](<https://sebastien.rigaux.be/en/tech-watch>)
