SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


DBCC consistency error


DBCC consistency error

Author
Message
Lavanyasri
Lavanyasri
SSC Eights!
SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)

Group: General Forum Members
Points: 945 Visits: 955
Hi Team

Last week we run dbcc command on few databases and found the below consistency errors in the database ,no allocation errors .

Please see below error and provide u r inputs .

The error due to decimal data type for column 'amount1' ,
i checked the table and the column is like

amount1 (decimal(13,4),null) ...

************************
DBCC results for 'table1'.
Msg 2570, Level 16, State 3, Line 1
Page (12:3592881), slot 119 in object ID 6447247, index ID 1,
partition ID 72057598160928768, alloc unit ID 72057598189436928 (type
"In-row data"). Column "Amount1" value is out of range for data type
"decimal". Update column to a legal value.
raadee
raadee
SSC-Enthusiastic
SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)

Group: General Forum Members
Points: 191 Visits: 476
Basically you have to identify the rows that contain the invalid value and update them with a valid value.
Have a look at:

Troubleshooting DBCC error 2570 in SQL Server 2005 and later versions
http://support.microsoft.com/kb/923247

Look for:
Finding Rows with Invalid Values Using T-SQL Queries
Decimal and Numeric data type:
--
SELECT col1 FROM table2
WHERE col2 > 9999999999.99999
OR col1 < -9999999999.99999
--
Keep in mind that you will need to adjust the values based on the precision and scale with which you have defined the decimal or numeric column. In the above example, the column was defined as col2 decimal(15,5).
Lavanyasri
Lavanyasri
SSC Eights!
SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)

Group: General Forum Members
Points: 945 Visits: 955
what is col1 in this script??
raadee
raadee
SSC-Enthusiastic
SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)

Group: General Forum Members
Points: 191 Visits: 476
Primary key maybe.
Something that helps you identify the row.


You could also narrow down the problem if above isn't working for you.
Select column from xx
where column between 1 and 100.

if it doesnt fail continue to between 100 and 1000 until you narrow it down.
In the end you will find the row causing the problem and then run an update
statment on that row that fixes the out of range value.
GilaMonster
GilaMonster
SSC Guru
SSC Guru (227K reputation)SSC Guru (227K reputation)SSC Guru (227K reputation)SSC Guru (227K reputation)SSC Guru (227K reputation)SSC Guru (227K reputation)SSC Guru (227K reputation)SSC Guru (227K reputation)

Group: General Forum Members
Points: 227437 Visits: 46339
Take a look at this article. http://www.sqlservercentral.com/articles/65804/, there's a section on data purity errors and a like to a kb article that goes into detail on fixing them

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


raadee
raadee
SSC-Enthusiastic
SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)

Group: General Forum Members
Points: 191 Visits: 476
Same link to the kb that I posted above.
Orlando Colamatteo
Orlando Colamatteo
SSC-Forever
SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)

Group: General Forum Members
Points: 40220 Visits: 14413
Let's make that link an actual link:

http://support.microsoft.com/kb/923247

The article Gail linked to above has a more "to the point" explanation of why these values can exist in your database, just search for the section named "Data Purity errors."

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Lavanyasri
Lavanyasri
SSC Eights!
SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)

Group: General Forum Members
Points: 945 Visits: 955
Thanks to all.

I go through the link , now my issue with the decimal data type

SELECT col1 FROM table2
WHERE col2 > 9999999999.99999
OR col1 < -9999999999.99999


In this script col1 is primary key and col2 is the column from eroor.

The same thing i checked for my issue,some tables doesn't have any column with primary key, and some tables have clumn primary key but its datatype is int not decimal .

suggest me how to get data_purity values using the above script ..

Col1 and col2 should be same data type (decimal)??

Lavanyasri
Roshan Jospeh
Roshan Jospeh
Hall of Fame
Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)

Group: General Forum Members
Points: 3155 Visits: 2093
Lavanyasri (2/21/2013)
Thanks to all.

I go through the link , now my issue with the decimal data type

SELECT col1 FROM table2
WHERE col2 > 9999999999.99999
OR col1 < -9999999999.99999


In this script col1 is primary key and col2 is the column from eroor.

The same thing i checked for my issue,some tables doesn't have any column with primary key, and some tables have clumn primary key but its datatype is int not decimal .

suggest me how to get data_purity values using the above script ..

Col1 and col2 should be same data type (decimal)??

Lavanyasri





The above code looks like a typo error
what you need to check is


SELECT col1 FROM table2
WHERE col2 > 9999999999.99999
OR col2 < -9999999999.99999




Here Col1 is the primary key and col2 is the decimel you need to check.

Col1(PK) doesnt need to be of the same datatype. You need this column to uniquely idenntify the corrupt rows,
decide on what to do with them

----------------------------------------------------------------------------------------------------------------------------------------------------
Roshan Joe

Jeff Moden -Forum Etiquette: How to post data/code on a forum to get the best help
Lavanyasri
Lavanyasri
SSC Eights!
SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)SSC Eights! (945 reputation)

Group: General Forum Members
Points: 945 Visits: 955
some tables doesn't have any column with primary key....
if i run that script on production, it will cause any performance issues ??
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search