Sql Server 2008 R2
The error is "... can not continue scan with NOLOCK..". These are the conditions:
- NOLOCK is not specified in any query. Transaction level is READ_COMMITTED
- When tested as a stand alone query batch, the operation completes successfully.
- When tested from withing a stored procedure context, the NOLOCK error occurs.
- There are no persisted tables being modified.
The below is just a snip. There are 5 levels all similar following the same pattern.
Example: level 4 would include aliases M0 thru M4 as left outer joins on @menu and M5 as a left outer join @menuInterface.
Why would executing in a batch not return an error and executing in a stored procedure context cause a NOLOCK error?
insert @menuInterface (
'<menuItem level="3' + M3.[menuXML] + '&
View Complete Post