Go to content Go to navigation Go to search

Get System.Diagnostics.Trace Output to you ASP.NET Page

Friday, 22 February 2008

How to view System.Diagnositcs.Trace messages on your ASP.NET page.

more...

SQL Server 2000: "Could not continue scan with NOLOCK due to data movement" or "I/O error (bad page ID) detected during read at offset"

Thursday, 1 February 2007

Running a SQL script against SQL Server 2000 (SP3 and SP4) gave me the following errors:

Could not continue scan with NOLOCK due to data movement. I/O error (bad page ID) detected during read at offset 0xBlah in file ‘C:\Program Files\Microsoft SQL Server\MSSQL\Data\Blah.mdf’.

To fix it, I had to run the following command three times for SQL server to fix the problem.

DBCC CHECKDB ('<DB_NAME>', REPAIR_ALLOW_DATA_LOSS )

To run this command, I had to first put the database in single user mode. To do so, I opened SQL Server Enterprise Manager, right-clicked the database, chose “Properties”, clicked the “Options” tab, checked the “Restrict access” check box, chose the “Single user” radio button, and clicked “OK”. I then connected to that database using Query Analyzer and ran my command three times.