How to over come from deadlock in embedded SQL through C# in SQL Server 2014? -
How to over come from deadlock in embedded SQL through C# in SQL Server 2014? -
i facing deadlock problem on dispatching.packagetrace table when below embedded sql invoked through c# programming language in ms sql server 2014.
below table design in database:
create table [dispatching].[packagetrace]( [packageid] [uniqueidentifier] rowguidcol not null, [partitionid] [numeric](26, 0) null, [conduit] [nvarchar](255) not null, primary key clustered ( [packageid] asc ) go set ansi_padding off go alter table [dispatching].[packagetrace] add together default (getdate()) [datecreated] go
below embedded sql invoked through c# programming language in ms sql server 2014:
if exists(select * dispatching.packagetrace packageid = 'klaslndsskok230m') begin update [dispatching].[packagetrace] set [conduit] = @conduit [packageid] = 'klaslndsskok230m' end else begin insert [dispatching].[packagetrace] ([packageid] ,[partitionid] ,[conduit] values (@packageid, @partitionid, @conduit) end
suggestions appreciated overcome deadlock.
thank in advance. --raj
c# database-deadlocks sql-server-2014 embedded-sql
Comments
Post a Comment