• Thanks for the quick replay

    Update Trn_GJobDet set CompletedDate=getdate() , CompletedEmpId=4335

    Where QueueId < 2 and JobCardId=116111 and StageId=53 and

    SubJobId=971218 and CompletedDate is Null and IsActive=1

    this is the actual query.Gjobid is the primary key.

    and the deadlock graph is as follows.

    <deadlock-list>

    <deadlock victim="processfef288">

    <process-list>

    <process id="processfef288" taskpriority="0" logused="276" waitresource="KEY: 7:72057594542686208 (dc00100960d3)" waittime="2072" ownerId="19382043303" transactionname="user_transaction" lasttranstarted="2010-12-10T19:40:10.057" XDES="0xbb2683b0" lockMode="U" schedulerid="3" kpid="10768" status="suspended" spid="799" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2010-12-10T19:40:10.077" lastbatchcompleted="2010-12-10T19:40:10.057" clientapp="iTracksWeb" hostname="INTEGRA-NET" hostpid="24068" loginname="itracksuser" isolationlevel="read uncommitted (1)" xactid="19382043303" currentdb="7" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056">

    <executionStack>

    <frame procname="Itracks.dbo.GLJSInsert" line="86" stmtstart="6146" stmtend="6638" sqlhandle="0x030007009c2aed23fddcd000489e00000100000000000000">

    Update Trn_GJobDet set CompletedDate=getdate() , CompletedEmpId=@CreatedEmpId

    Where QueueId < @InsertQId and JobCardId=@JobCardId and StageId=@StageId and

    SubJobId=@SubJobId and CompletedDate is Null and IsActive=1 </frame>

    </executionStack>

    <inputbuf>

    Proc [Database Id = 7 Object Id = 602745500] </inputbuf>

    </process>

    <process id="process1e8772bc8" taskpriority="0" logused="1924" waitresource="KEY: 7:72057594542686208 (db00a931b74e)" waittime="2064" ownerId="19382043526" transactionname="user_transaction" lasttranstarted="2010-12-10T19:40:10.227" XDES="0xe77df970" lockMode="U" schedulerid="4" kpid="6976" status="suspended" spid="154" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2010-12-10T19:40:10.250" lastbatchcompleted="2010-12-10T19:40:10.247" clientapp="iTracksWeb" hostname="INTEGRA-NET" hostpid="24068" loginname="itracksuser" isolationlevel="read uncommitted (1)" xactid="19382043526" currentdb="7" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056">

    <executionStack>

    <frame procname="Itracks.dbo.GLJSInsert" line="80" stmtstart="5524" stmtend="6054" sqlhandle="0x030007009c2aed23fddcd000489e00000100000000000000">

    Update Trn_GJobDet set CompletedDate=getdate() , CompletedEmpId=@CreatedEmpId

    Where QueueId = @RejectedQueueId + 1 and JobCardId=@JobCardId and

    StageId=@StageId and SubJobId=@SubJobId and CompletedDate is Null and IsActive=1 </frame>

    </executionStack>

    <inputbuf>

    Proc [Database Id = 7 Object Id = 602745500] </inputbuf>

    </process>

    </process-list>

    <resource-list>

    <keylock hobtid="72057594542686208" dbid="7" objectname="Itracks.dbo.Trn_GJobDet" indexname="PK_trn_GJobDet1" id="locked3c8d00" mode="X" associatedObjectId="72057594542686208">

    <owner-list>

    <owner id="process1e8772bc8" mode="X"/>

    </owner-list>

    <waiter-list>

    <waiter id="processfef288" mode="U" requestType="wait"/>

    </waiter-list>

    </keylock>

    <keylock hobtid="72057594542686208" dbid="7" objectname="Itracks.dbo.Trn_GJobDet" indexname="PK_trn_GJobDet1" id="lockc57e9080" mode="X" associatedObjectId="72057594542686208">

    <owner-list>

    <owner id="processfef288" mode="X"/>

    </owner-list>

    <waiter-list>

    <waiter id="process1e8772bc8" mode="U" requestType="wait"/>

    </waiter-list>

    </keylock>

    </resource-list>

    </deadlock>

    </deadlock-list>