我正在一个数据输入面板上,有超过300个客户端一次更新数据表上的数据,我使用存储过程执行数据表中的更新,看起来像这样..更新存储过程中的死锁
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[Update_Tbl_Client_Bpo_Data]
@Id int,
@CId varchar(50),
@Tbc_No varchar(200),
@Name varchar(200),
@EmailId varchar(200),
@MobileNo varchar(50),
@Gender varchar(50),
@LicenseNo varchar(200),
@GirNo varchar(200),
@PanNo varchar(200),
@H_Address varchar(500),
@H_City varchar(200),
@H_PinNo varchar(200),
@H_county varchar(200),
@H_State varchar(200),
@O_Address varchar(200),
@O_City varchar(200),
@O_PinNo varchar(200),
@LAL varchar(200),
@MRNNo varchar(200),
@AF varchar(200),
@NRI varchar(200),
@CP varchar(200),
@Status varchar(200)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
update Tbl_Client_Bpo_Data
set
[email protected]_No,
[email protected],
[email protected],
[email protected],
[email protected],
[email protected],
[email protected],
[email protected],
[email protected]_Address,
[email protected]_City,
[email protected]_PinNo,
[email protected]_county,
[email protected]_State,
[email protected]_Address,
[email protected]_City,
[email protected]_PinNo,
[email protected],
[email protected],
[email protected],
[email protected],
[email protected],
[email protected] from Tbl_Client_Bpo_Data where [email protected] and [email protected]
END
此存储过程得到死锁错误是这样的...
transaction was deadlocked on lock resources with another process and has been chosen as the deadlock victim. rerun the transaction.
我创建一个备份模块发现错误日志,显示这个存储过程得到的僵局,而更多的客户也尝试更新数据。 。
我还添加了SET TRANSACTION ISOLATION LEVEL READ COMMITTED
,但它不为我工作.. 有人可以给出一个解决方案来解决这个问题..
或有某种机制保持执行过程,直到先前执行完成
[事务(进程ID)的可能的复制被死锁的锁资源与另一个进程,并已被选作死锁牺牲品。重新运行事务](http://stackoverflow.com/questions/9212255/transaction-process-id-was-deadlocked-on-lock-resources-with-another-process-a) – MusicLovingIndianGirl
@AishvaryaKarthik我还补充了'ISOLATION LEVEL '..我还在我的问题中提到了这个问题 –
你的桌子上是否有索引会更新? – MikeAinOz