2014-10-30 23:28:01.82 spid5s      Deadlock encountered .... Printing deadlock information
2014-10-30 23:28:01.82 spid5s      Wait-for graph
2014-10-30 23:28:01.82 spid5s      
2014-10-30 23:28:01.82 spid5s      Node:1

2014-10-30 23:28:01.82 spid5s      PAGE: 6:1:6666                 CleanCnt:3 Mode:IX Flags: 0x3
2014-10-30 23:28:01.82 spid5s       Grant List 1:
2014-10-30 23:28:01.82 spid5s         Owner:0x000000027DB15F80 Mode: IX       Flg:0x40 Ref:0 Life:02000000 SPID:53 ECID:0 XactLockInfo: 0x000000027277D6E8
2014-10-30 23:28:01.82 spid5s         SPID: 53 ECID: 0 Statement Type: UPDATE Line #: 338
2014-10-30 23:28:01.82 spid5s         Input Buf: Language Event: (@0 bigint,@1 nvarchar(4000),@2 nvarchar(4000),@3 nvarchar(4000),@4 bigint,@5 bigint,@6 int,@7 nvarchar(4000),@8 datetime,@9 bigint)UPDATE [Product] SET [MaterialOid] = @0, [FullName] = @1, [ShortName] = @2, [SKU] = @3, [UnitOfMeasureLookupOid] = @4, [Def
2014-10-30 23:28:01.82 spid5s       Grant List 3:
2014-10-30 23:28:01.82 spid5s      Requested by: 
2014-10-30 23:28:01.82 spid5s        ResType:LockOwner Stype:'OR'Xdes:0x000000027381D048 Mode: S SPID:52 BatchID:0 ECID:0 TaskProxy:(0x000000026E3E8608) Value:0x7daf8580 Cost:(0/628)
2014-10-30 23:28:01.82 spid5s      
2014-10-30 23:28:01.82 spid5s      Node:2

2014-10-30 23:28:01.82 spid5s      PAGE: 6:1:6666                 CleanCnt:3 Mode:IX Flags: 0x3
2014-10-30 23:28:01.82 spid5s       Grant List 1:
2014-10-30 23:28:01.82 spid5s       Grant List 3:
2014-10-30 23:28:01.82 spid5s         Owner:0x000000027DAF8780 Mode: IX       Flg:0x40 Ref:0 Life:02000000 SPID:52 ECID:0 XactLockInfo: 0x000000027381D088
2014-10-30 23:28:01.82 spid5s         SPID: 52 ECID: 0 Statement Type: UPDATE Line #: 338
2014-10-30 23:28:01.82 spid5s         Input Buf: Language Event: (@0 bigint,@1 nvarchar(4000),@2 nvarchar(4000),@3 nvarchar(4000),@4 bigint,@5 bigint,@6 int,@7 nvarchar(4000),@8 datetime,@9 bigint)UPDATE [Product] SET [MaterialOid] = @0, [FullName] = @1, [ShortName] = @2, [SKU] = @3, [UnitOfMeasureLookupOid] = @4, [Def
2014-10-30 23:28:01.82 spid5s      Requested by: 
2014-10-30 23:28:01.82 spid5s        ResType:LockOwner Stype:'OR'Xdes:0x000000027277D6A8 Mode: S SPID:53 BatchID:0 ECID:0 TaskProxy:(0x0000000271DDE608) Value:0x7db03740 Cost:(0/628)
2014-10-30 23:28:01.82 spid5s      
2014-10-30 23:28:01.82 spid5s      Victim Resource Owner:
2014-10-30 23:28:01.82 spid5s       ResType:LockOwner Stype:'OR'Xdes:0x000000027381D048 Mode: S SPID:52 BatchID:0 ECID:0 TaskProxy:(0x000000026E3E8608) Value:0x7daf8580 Cost:(0/628)
2014-10-30 23:28:01.82 spid28s     deadlock-list
2014-10-30 23:28:01.82 spid28s      deadlock victim=process2788bdc38
2014-10-30 23:28:01.82 spid28s       process-list
2014-10-30 23:28:01.82 spid28s        process id=process2788bdc38 taskpriority=0 logused=628 waitresource=PAGE: 6:1:6666  waittime=2954 ownerId=299410 transactionname=user_transaction lasttranstarted=2014-10-30T23:27:58.793 XDES=0x27381d048 lockMode=S schedulerid=4 kpid=5376 status=suspended spid=52 sbid=0 ecid=0 priority=0 trancount=1 lastbatchstarted=2014-10-30T23:27:58.870 lastbatchcompleted=2014-10-30T23:27:58.860 lastattention=1900-01-01T00:00:00.860 clientapp=.Net SqlClient Data Provider hostname=WIN-2MVTN2NACEC hostpid=3684 loginname=sa isolationlevel=read committed (2) xactid=299410 currentdb=6 lockTimeout=4294967295 clientoption1=673316896 clientoption2=128056
2014-10-30 23:28:01.82 spid28s         executionStack
2014-10-30 23:28:01.82 spid28s          frame procname=MY_DB.dbo.Product_Audit_Update line=338 stmtstart=32870 stmtend=34240 sqlhandle=0x03000600c80ef6435743ff00d4a3000000000000000000000000000000000000000000000000000000000000
2014-10-30 23:28:01.82 spid28s     With NextRowVersions
2014-10-30 23:28:01.82 spid28s     	as
2014-10-30 23:28:01.82 spid28s     	(Select Keys.PrimaryKey, max(AH.[RowVersion]) + 1 as NextRowVersion
2014-10-30 23:28:01.82 spid28s     	From	[sys_audit].AuditHeader AH
2014-10-30 23:28:01.82 spid28s     	inner join @Keys as Keys
2014-10-30 23:28:01.82 spid28s     		on		quotename(AH.PrimaryKey) + isnull(quotename(AH.PrimaryKey2),'') + isnull(quotename(AH.PrimaryKey3),'') + isnull(quotename(AH.PrimaryKey4),'') + isnull(quotename(AH.PrimaryKey5),'') = Keys.PrimaryKey
2014-10-30 23:28:01.82 spid28s     		and		AH.TableName = '[dbo].[Product]'
2014-10-30 23:28:01.82 spid28s     	group by Keys.PrimaryKey
2014-10-30 23:28:01.82 spid28s     	having count(*) > 1
2014-10-30 23:28:01.82 spid28s     	)
2014-10-30 23:28:01.82 spid28s        UPDATE Keys
2014-10-30 23:28:01.82 spid28s          SET  Keys.[NextRowVersion] = NRV.NextRowVersion
2014-10-30 23:28:01.82 spid28s          FROM @Keys as Keys
2014-10-30 23:28:01.82 spid28s          INNER JOIN	NextRowVersions NRV
2014-10-30 23:28:01.82 spid28s     		ON		Keys.PrimaryKey = NRV.PrimaryKey;
2014-10-30 23:28:01.82 spid28s     -----
2014-10-30 23:28:01.82 spid28s      -- fix the RowVersion in the Audit table     
2014-10-30 23:28:01.82 spid28s          frame procname=adhoc line=1 stmtstart=264 sqlhandle=0x0200000064291a2320e6d536671e4a48d0dd813e96231c6c0000000000000000000000000000000000000000
2014-10-30 23:28:01.82 spid28s     UPDATE [Product] SET [MaterialOid] = @0, [FullName] = @1, [ShortName] = @2, [SKU] = @3, [UnitOfMeasureLookupOid] = @4, [DefaultQcStatusLookupOid] = @5, [FullPalletQuantity] = @6, [ModifiedBy] = @7, [ModifiedOn] = @8 WHERE [Oid] = @9     
2014-10-30 23:28:01.82 spid28s          frame procname=unknown line=1 sqlhandle=0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
2014-10-30 23:28:01.82 spid28s     unknown     
2014-10-30 23:28:01.82 spid28s         inputbuf
2014-10-30 23:28:01.82 spid28s     (@0 bigint,@1 nvarchar(4000),@2 nvarchar(4000),@3 nvarchar(4000),@4 bigint,@5 bigint,@6 int,@7 nvarchar(4000),@8 datetime,@9 bigint)UPDATE [Product] SET [MaterialOid] = @0, [FullName] = @1, [ShortName] = @2, [SKU] = @3, [UnitOfMeasureLookupOid] = @4, [DefaultQcStatusLookupOid] = @5, [FullPalletQuantity] = @6, [ModifiedBy] = @7, [ModifiedOn] = @8 WHERE [Oid] = @9    
2014-10-30 23:28:01.82 spid28s        process id=process28101d868 taskpriority=0 logused=628 waitresource=PAGE: 6:1:6666  waittime=2951 ownerId=299412 transactionname=user_transaction lasttranstarted=2014-10-30T23:27:58.860 XDES=0x27277d6a8 lockMode=S schedulerid=2 kpid=3588 status=suspended spid=53 sbid=0 ecid=0 priority=0 trancount=1 lastbatchstarted=2014-10-30T23:27:58.880 lastbatchcompleted=2014-10-30T23:27:58.877 lastattention=1900-01-01T00:00:00.877 clientapp=.Net SqlClient Data Provider hostname=WIN-2MVTN2NACEC hostpid=3684 loginname=sa isolationlevel=read committed (2) xactid=299412 currentdb=6 lockTimeout=4294967295 clientoption1=673316896 clientoption2=128056
2014-10-30 23:28:01.82 spid28s         executionStack
2014-10-30 23:28:01.82 spid28s          frame procname=MY_DB.dbo.Product_Audit_Update line=338 stmtstart=32870 stmtend=34240 sqlhandle=0x03000600c80ef6435743ff00d4a3000000000000000000000000000000000000000000000000000000000000
2014-10-30 23:28:01.82 spid28s     With NextRowVersions
2014-10-30 23:28:01.82 spid28s     	as
2014-10-30 23:28:01.82 spid28s     	(Select Keys.PrimaryKey, max(AH.[RowVersion]) + 1 as NextRowVersion
2014-10-30 23:28:01.82 spid28s     	From	[sys_audit].AuditHeader AH
2014-10-30 23:28:01.82 spid28s     	inner join @Keys as Keys
2014-10-30 23:28:01.82 spid28s     		on		quotename(AH.PrimaryKey) + isnull(quotename(AH.PrimaryKey2),'') + isnull(quotename(AH.PrimaryKey3),'') + isnull(quotename(AH.PrimaryKey4),'') + isnull(quotename(AH.PrimaryKey5),'') = Keys.PrimaryKey
2014-10-30 23:28:01.82 spid28s     		and		AH.TableName = '[dbo].[Product]'
2014-10-30 23:28:01.82 spid28s     	group by Keys.PrimaryKey
2014-10-30 23:28:01.82 spid28s     	having count(*) > 1
2014-10-30 23:28:01.82 spid28s     	)
2014-10-30 23:28:01.82 spid28s        UPDATE Keys
2014-10-30 23:28:01.82 spid28s          SET  Keys.[NextRowVersion] = NRV.NextRowVersion
2014-10-30 23:28:01.82 spid28s          FROM @Keys as Keys
2014-10-30 23:28:01.82 spid28s          INNER JOIN	NextRowVersions NRV
2014-10-30 23:28:01.82 spid28s     		ON		Keys.PrimaryKey = NRV.PrimaryKey;
2014-10-30 23:28:01.82 spid28s     -----
2014-10-30 23:28:01.82 spid28s      -- fix the RowVersion in the Audit table     
2014-10-30 23:28:01.82 spid28s          frame procname=adhoc line=1 stmtstart=264 sqlhandle=0x0200000064291a2320e6d536671e4a48d0dd813e96231c6c0000000000000000000000000000000000000000
2014-10-30 23:28:01.82 spid28s     UPDATE [Product] SET [MaterialOid] = @0, [FullName] = @1, [ShortName] = @2, [SKU] = @3, [UnitOfMeasureLookupOid] = @4, [DefaultQcStatusLookupOid] = @5, [FullPalletQuantity] = @6, [ModifiedBy] = @7, [ModifiedOn] = @8 WHERE [Oid] = @9     
2014-10-30 23:28:01.82 spid28s          frame procname=unknown line=1 sqlhandle=0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
2014-10-30 23:28:01.82 spid28s     unknown     
2014-10-30 23:28:01.82 spid28s         inputbuf
2014-10-30 23:28:01.82 spid28s     (@0 bigint,@1 nvarchar(4000),@2 nvarchar(4000),@3 nvarchar(4000),@4 bigint,@5 bigint,@6 int,@7 nvarchar(4000),@8 datetime,@9 bigint)UPDATE [Product] SET [MaterialOid] = @0, [FullName] = @1, [ShortName] = @2, [SKU] = @3, [UnitOfMeasureLookupOid] = @4, [DefaultQcStatusLookupOid] = @5, [FullPalletQuantity] = @6, [ModifiedBy] = @7, [ModifiedOn] = @8 WHERE [Oid] = @9    
2014-10-30 23:28:01.82 spid28s       resource-list
2014-10-30 23:28:01.82 spid28s        pagelock fileid=1 pageid=6666 dbid=6 subresource=FULL objectname=MY_DB.sys_audit.AuditHeader id=lock27da83700 mode=IX associatedObjectId=72057594039304192
2014-10-30 23:28:01.82 spid28s         owner-list
2014-10-30 23:28:01.82 spid28s          owner id=process28101d868 mode=IX
2014-10-30 23:28:01.82 spid28s          owner id=process28101d868 mode=S requestType=convert
2014-10-30 23:28:01.82 spid28s         waiter-list
2014-10-30 23:28:01.82 spid28s          waiter id=process2788bdc38 mode=S requestType=convert
2014-10-30 23:28:01.82 spid28s        pagelock fileid=1 pageid=6666 dbid=6 subresource=FULL objectname=MY_DB.sys_audit.AuditHeader id=lock27da83700 mode=IX associatedObjectId=72057594039304192
2014-10-30 23:28:01.82 spid28s         owner-list
2014-10-30 23:28:01.82 spid28s          owner id=process2788bdc38 mode=IX
2014-10-30 23:28:01.82 spid28s          owner id=process2788bdc38 mode=S requestType=convert
2014-10-30 23:28:01.82 spid28s         waiter-list
2014-10-30 23:28:01.82 spid28s          waiter id=process28101d868 mode=S requestType=convert