Gerard Gerard - 1 year ago 56
SQL Question

Can an Insert/update followed by a select (nolock) yield unexpected results with same data?

In a stored procedure,

can an insert/update followed by a select (nolock) on the same record yield unexpected results?

Do I always get the (complete) updated/inserted record?

Thanks in advance for your help!

Answer Source

If everything is done by single process, then data will be correct. But if the stored procedure is called from a different process id and user is doing select (nolock) in other process then discrepancy in data can happen for select.

As stored procedure may be still in use.