problem query … if not exists (…) update
IF NOT EXISTS ( SELECT * FROM dbo.tblFinanceAllocation a INNER JOIN dbo.tblFinancePostAllocation pa ON pa.AllocationID = a.AllocationIDWHERE a.AllocationJobID = @AllocationJobID AND pa.Posted IS NULL) EXEC dbo.spFinancePostAllocationJobEnd @AllocationJobID
… which calls a proc that contains 3 update statements.
I'm not sure where to start, I looked at 'select 1…', then 'update … where not exists' then noticed unusual plans ie: 4 of them every day (we have mdw). However, if the answer is not going to be an index I am stuck :). advise please.