Hi @Rohit Kochar ,
Welcome to Microsoft Q&A!
“sqlalchemy.exc.ProgrammingError: (pyodbc.ProgrammingError) (‘42000’, ‘[42000] [FreeTDS][SQL Server]Could not continue scan with NOLOCK due to data movement. (601) (SQLExecDirectW)’)”
This indicates a database consistency error. DBCC CHECKDB command checks the physical and logical integrity of all the database objects. We can use this command to detect and report the consistency error.
Restoring the last known successful backup is always the best option. If there is no backup, then you can decide what to do based on the results of DBCC CHECKDB. For example, if you have a problem with your indexes, then you can choose to rebuild the indexes. Finally, there is the option of using REPAIR_ALLOW_DATA_LOSS to repair the corrupted pages. However, this option can cause you to lose some of the data.
You can refer to this article: Fixing Error 601: Could not continue scan with NOLOCK due to data movement
Best regards,
Seeya
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.