Why does my SQL Server UPSERT code sometimes not block?
问题 I have a table ImportSourceMetadata which I use to control an import batch process. It contains a PK column SourceId and a data column LastCheckpoint . The import batch process reads the LastCheckpoint for a given SourceId , performs some logic (on other tables), then updates the LastCheckpoint for that SourceId or inserts it if it doesn't exist yet . Multiple instances of the process run at the same time, usually with disjunct SourceIds , and I need high parallelity for those cases. However,