Home Forums SQL Server 2005 Administering Could not continue scan with NOLOCK due to data movement. RE: Could not continue scan with NOLOCK due to data movement.

  • This post really helped me and together with the previous post from RBarry Young I was able to resolve the problem.

    I was experiencing the NOLOCK error when running a select statement on a read only log shipping secondary database. The same database on the primary ran the statement with no issue. It turns out a large index had errors which I discovered when running [font="Courier New"]dbcc checkdb ('DB NAME')[/font] on the secondary read only database. I ran the same statement on the production database and it had no errors. I rebuild the index on the primary production server using a maintenance plan, then manually shipped over the logs and applied them. After which the database on the secondary log shipping server started running the query properly.

    I now understand NOLOCK is applied by default when running a select statement on a read only database, so removing it from the statement makes no difference.

    Many thanks to all those that contributed to this post and got me out of a pickle with a very demanding customer! 😀