I am using Microsoft SQL Server version:
Microsoft SQL Server 2016 (RTM) - 13.0.1601.5 (X64) Apr 29 2016 23:23:58 Copyright (c) Microsoft Corporation Enterprise Edition (64-bit) on Windows Server 2016 Datacenter 6.3 (Build 14393: ) (Hypervisor)
ReportType is a user-defined type like below:
When I run the
UpdateReports procedure, it works good in normal situations. But when it is executed while a full backup is running on the database, Update Statistic (I think many reads of DB), this
UpdateReports procedure deadlocks and it takes about 10 minutes to complete.
Is it because I am using
I searched this issue and many people saying MERGE is not stable....
Could you please let me know if there is any good alternative instead of
If I can use
IF/ELSE, UPDATE/INSERT instead of
MERGE.... I am worried about concurrency