UPDATE
BondPrices
SET
MarketValueOwned = Holdings.Amount
FROM
BondPrices BondPrices
INNER JOIN
(
SELECT
PM.SecurityId,
SUM(Pos.QuantityTraded * Pos.Mark) AS Amount
FROM
Position Pos --WITH (NOLOCK, READUNCOMMITTED)
INNER JOIN
PositionMaster PM --WITH (NOLOCK, READUNCOMMITTED)
ON
Pos.PositionMasterId = PM.PositionMasterId
WHERE
Pos.Date = @ReportDate
GROUP BY
PM.SecurityId
) Holdings ON
BondPrices.SecurityId = Holdings.SecurityId
WHERE
BondPrices.Date = @ReportDate
please help me is that correct that i put WITH (NOLOCK, READUNCOMMITTED) inside select statement of update block?
i need to do this for reporting purpose but i’m confused whether it is correct or not?
According to Table Hints (Transact-SQL):
Tables
Fireball..PositionandFireball_Reporting..PositionMasteraren’t modified so this hint should be fine.Edit:
I assume that you wanted write
READUNCOMMITTEDinstead ofUNCOMMITTED.