Hello All,
I am trying to run the query below in query analyzer and I keep getting the following error message:
Server: Msg 1205, Level 13, State 2, Line 1
Transaction (Process ID 53) was deadlocked on thread | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
I have been all through Books on line and nothing I have tried seems to work. If I kill the process, I can run the query successfully immediately after that... but after about 1 minute I get the deadlock message again.
Any help would be appreciated!
SELECT
(tu.user_name_first + ' ' + tu.user_name_last) as RepName,
fv.key_eautorep as RepID,
sum(case when cs.isFleet = 1 then 1 else 0 end) as eFleetCount,
sum(case when cs.isFleet = 0 then 1 else 0 end) as eAutoCount
FROM tbl_users as tu, fn_vehicles as fv, claim_status as cs, fn_acord as fn
WHERE tu.user_id = fv.key_eautorep
AND fv.transid = cs.transid
AND cs.transid = fn.transid
AND tu.client_id = 161
AND tu.inactive = 0
AND fv.repair_shop_id <> 1885
AND fv.key_eautorep NOT IN (128,162,229)
AND fv.subprocid NOT IN (14,30)
AND (fv.repair_shop_id > 0 or cs.clientid = 566)
GROUP BY tu.user_name_first, tu.user_name_last, fv.key_eautorep
ORDER BY RepName
I am trying to run the query below in query analyzer and I keep getting the following error message:
Server: Msg 1205, Level 13, State 2, Line 1
Transaction (Process ID 53) was deadlocked on thread | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
I have been all through Books on line and nothing I have tried seems to work. If I kill the process, I can run the query successfully immediately after that... but after about 1 minute I get the deadlock message again.
Any help would be appreciated!
SELECT
(tu.user_name_first + ' ' + tu.user_name_last) as RepName,
fv.key_eautorep as RepID,
sum(case when cs.isFleet = 1 then 1 else 0 end) as eFleetCount,
sum(case when cs.isFleet = 0 then 1 else 0 end) as eAutoCount
FROM tbl_users as tu, fn_vehicles as fv, claim_status as cs, fn_acord as fn
WHERE tu.user_id = fv.key_eautorep
AND fv.transid = cs.transid
AND cs.transid = fn.transid
AND tu.client_id = 161
AND tu.inactive = 0
AND fv.repair_shop_id <> 1885
AND fv.key_eautorep NOT IN (128,162,229)
AND fv.subprocid NOT IN (14,30)
AND (fv.repair_shop_id > 0 or cs.clientid = 566)
GROUP BY tu.user_name_first, tu.user_name_last, fv.key_eautorep
ORDER BY RepName