Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 12963

DBCC CHECKDB

$
0
0

I have a stored procedure that will get all the database name on an instance. It will then insert the results of DBCC execution into a table.

INSERT INTO tblErrors(
	Error,[Level],[State],MessageText,RepairLevel,[Status],[DbId],Id, IndId,
   [File],Page,Slot,RefFile,RefPage,RefSlot,Allocation
   )
  EXEC ('dbcc checkdb(''' + @db_name + ''') with tableresults, all_errormsgs')

I then scheduled a job to run the SP.

The problem is my job kept failing with

"Syntax error converting the nvarchar value 'repair_allow_data_loss' to a column of data type int."

So when I do DBCC CHECKDB ('ABC'),  I get

Msg 2576, Level 16, State 1, Line 1

IAM page (0:0) is pointed to by the previous pointer of IAM page (1:80) object ID 1858105660 index ID 0 but was not detected in the scan.

CHECKDB found 1 allocation errors and 0 consistency errors in table '(Object ID 1858105660)' (object ID 1858105660).

DBCC results for 'tblBCD'.

There are 2966 rows in 9 pages for object 'tblBCD'.

I understand the table (tblBCD) has issues; however, is there a way to let the job continue (without erroring out) and just insert the issue record intotblErrors?

Thanks.

Edited: This is for SQL2000





Viewing all articles
Browse latest Browse all 12963

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>