When a deadlock occurs, by default, SQL Server choose a deadlock "victim" by identifying which of the two processes will use the least amount of resources to rollback, and then returns error message 1205.
But what if you don't like default behavior? Can you change it? Yes, you can, by using the following command:
SET DEADLOCK_PRIORITY { LOW | NORMAL | @deadlock_var }
Where:
Low tells SQL Server that the current session should be the preferred deadlock victim, not the session that incurs the least amount of rollback resources. The standard deadlock error message 1205 is returned.
Normal tells SQL Server to use the default deadlock method.
@deadlock_var is a character variable specifying which deadlock method you want to use. Specify "3" for low, or "6" for normal.
This command is set a runtime for a specified user connection. [2000]
Performance of the SQL MERGE vs. INSERT/UPDATE
-
MERGE is designed to apply both UPDATE and INSERTs into a target table from
a source table. The statement can do both at once, or simply do INSERTs or
on...
1 comment:
Nice job Good Going Dear!!!
Visit My Site
www.discobhangra.com
www.technewstime.com
Post a Comment