Can't reduce cost of query plan and get rid of Key Lookup because of cursor
2
votes
1
answer
689
views
I have tried to create a non-clustered index on the fields that are in the output list which are created_by and Chk1002 .I don't have a column called Chk1002 anywhere .
I have read here that it has to do with the Cursor .
Is there any way I could keep the Cursor and get reduce the cost of the Query plan and get rid of the Key Lookup?
DECLARE @ClaimUniqueNo INT
DECLARE ClaimAudit CURSOR
FOR
SELECT CA.Claim_Audit_ID, CA.Claim_Audit_Action, CA.Create_Date, CA.Created_By, C.Claim_Status
FROM dbo.Claim_Audit_Tbl CA LEFT JOIN Claim_Tbl C
ON CA.Claim_Unique_No = C.Claim_Unique_No
WHERE CA.Claim_Unique_No = @ClaimUniqueNo
ORDER BY Create_Date ASC


Asked by Lucy
(299 rep)
May 30, 2018, 03:20 PM
Last activity: May 31, 2018, 03:10 PM
Last activity: May 31, 2018, 03:10 PM