enrique_aeo
asked on
10774 - Instead of using the hint no_lock
Hi experts,
can you give me an example in TSQL for this:
Instead of using the hint no_lock would be better to use isolation levels
read_commited_snapshot
can you give me an example in TSQL for this:
Instead of using the hint no_lock would be better to use isolation levels
read_commited_snapshot
Without more information about your context, there is no "better" method. Only a caveat: NOLOCK can result in wrong results due to phantom reads or skips on data.
ASKER
It is advice for the optimization of queries
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Might you help me understand the read_commited_snapshot
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
enrique_aeo, do you still need help on this question?
ASKER
an example would be perfect TSQL code
Example 1 - Read Committed
Example 2 - Nolock
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
BEGIN TRANSACTION;
UPDATE StockPrices
SET ClosingPrice = @StockClosingPrice
WHERE StockTicker = 'AAPL'
COMMIT TRANSACTION
Example 2 - Nolock
SELECT *
FROM dbo.Stocks
WITH (NOLOCK)
WHERE stockticker = 'AAPL'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Please ScottPletcher:
Might complete the example. The code ste5an friend helped me a lot, please your support. Thank You
Might complete the example. The code ste5an friend helped me a lot, please your support. Thank You