Select the product you need help with
Troubleshooting DBCC error 2570 in SQL Server 2005 and later versionsArticle ID: 923247 - View products that this article applies to. On This PageINTRODUCTIONThis article describes SQL Server error 2570, what causes
the error, and how to resolve the problem. MORE INFORMATIONDATA_PURITY ChecksIn SQL Server 2005, a new option, DATA_PURITY, has been added to the DBCC CHECKDB and DBCC CHECKTABLE commands. When you execute a DBCC CHECKDB or DBCC CHECKTABLE command with this option enabled, the command will perform "data purity" validations on every column value in all rows of the table or tables in the database. These new checks are performed to ensure that the values stored in the columns are valid (that is, that the values are not out-of-range for the domain associated with the data type of that column). The nature of the validation performed depends on the data type of the column. The following non-exhaustive list gives a few examples:Collapse this table
The data purity validation checks are not enabled automatically for all databases. The checks are enabled depending on several factors:
SYMPTOMSInvalid or out-of-range data may have been stored in the SQL Server database in earlier versions for the following reasons:
Some of the symptoms you may notice due to the presence of invalid data include (but are not limited to):
DATA_PURITY Problem ReportWhen you execute a DBCC CHECKDB or DBCC CHECKTABLE command with the DATA_PURITY option enabled (or the data purity checks are run automatically), and invalid data exists in the tables checked by the DBCC commands, the DBCC output includes additional messages that indicate the problems with the data. Some sample error messages that indicate data purity problems are shown below:DBCC results for
"account_history". Msg 2570, Level 16, State 2, Line 1 Page (1:1073), slot 33 in object ID 1977058079, index ID 0, partition ID 129568478265344, alloc unit ID 129568478265344 (type "In-row data"). Column "account_name_japan" value is out of range for data type "nvarchar". Update column to a legal value. Msg 2570, Level 16, State 2, Line 1 Page (1:1156), slot 120 in object ID 1977058079, index ID 0, partition ID 129568478265344, alloc unit ID 129568478265344 (type "In-row data"). Column "account_name_japan" value is out of range for data type "nvarchar". Update column to a legal value. There are 153137 rows in 1080 pages for object "account_history". CHECKDB found 0 allocation errors and 338 consistency errors in table "account_history" (object ID 1977058079). CHECKDB found 0 allocation errors and 338 consistency errors in database 'BadUnicodeData'. DBCC execution completed. If DBCC printed error messages, contact your system administrator. DBCC results for 'table1'. Msg 2570, Level 16, State 3, Line 1 Page (1:154), slot 0 in object ID 2073058421, index ID 0, partition ID 72057594038321152, alloc unit ID 72057594042318848 (type "In-row data"). Column "col2" value is out of range for data type "real". Update column to a legal value. There are 4 rows in 2 pages for object "table1". CHECKDB found 0 allocation errors and 1 consistency errors in table 'table1' (object ID 2073058421). CHECKDB found 0 allocation errors and 1 consistency errors in database 'realdata'. DBCC execution completed. If DBCC printed error messages, contact your system administrator. DBCC results for 'table2'. Msg 2570, Level 16, State 3, Line 1 Page (1:155), slot 0 in object ID 2105058535, index ID 0, partition ID 72057594038452224, alloc unit ID 72057594042449920 (type "In-row data"). Column "col2" value is out of range for data type "decimal". Update column to a legal value. There are 4 rows in 1 pages for object "table2". CHECKDB found 0 allocation errors and 1 consistency errors in table 'table2' (object ID 2105058535). CHECKDB found 0 allocation errors and 1 consistency errors in database 'realdata'. DBCC execution completed. If DBCC printed error messages, contact your system administrator. DBCC results for 'table3'. Msg 2570, Level 16, State 3, Line 1 Page (1:157), slot 0 in object ID 2121058592, index ID 0, partition ID 72057594038517760, alloc unit ID 72057594042515456 (type "In-row data"). Column "col2" value is out of range for data type "datetime". Update column to a legal value. There are 3 rows in 1 pages for object "table3". CHECKDB found 0 allocation errors and 1 consistency errors in table 'table3' (object ID 2121058592). CHECKDB found 0 allocation errors and 1 consistency errors in database 'realdata'. DBCC execution completed. If DBCC printed error messages, contact your system administrator. Fixing the Data Purity ProblemThe 2570 errors cannot be repaired using any of the DBCC repair options. This is because it is impossible for DBCC to determine what value should used to replace the invalid column value. Thus, the column value must be manually updated.To perform a manual update, you have to find the row that has the problem. There are two ways to accomplish this.
Once you find the correct row, a decision needs to be made on the new value that will be used to replace the existing invalid data. This decision has to be made very carefully based on the range of values that work for the application as well as what makes logical sense for that particular row of data. The choices you have are:
Finding Rows with Invalid Values Using T-SQL QueriesThe type of query that you need to execute to find rows that have invalid values depends on the data type of the column that reported a problem. If you look at the 2570 error message, you will notice two important pieces of information that will help you with this. In the following example, the column "account_name_japan" value is out of range for data type "nvarchar." We can easily identify the column that has the problem as well as the data type of the column involved. Thus, once you know the data type and the column involved, you can formulate the query to find the rows that contain invalid values for that column, selecting the columns needed to identify that row (as the predicates in a WHERE clause) for any further update or delete.Unicode data type: Float data type: Real data type: Date Time data type: You will need to execute two different queries to identify the rows that contain invalid values for date time column. Finding rows with invalid value using the physical location:You can use this method if you are unable to find the rows of interest using the T-SQL method discussed above. In the 2570 error message, the physical location of the row that contains the invalid value is printed. For example, look at the following message:Page (1:157),
slot 0 in object ID 2121058592, index ID 0, partition ID 72057594038517760,
alloc unit ID 72057594042515456 (type "In-row data"). Column "col2" value is
out of range for data type "datetime". Update column to a legal
value.
WARNING We recommend that you use the first method (that is, use T-SQL queries to find the required information). Use the DBCC PAGE command only as a last resort. Take utmost care while you use this command in a production environment. It is advisable to restore the production database on a test server, then get all the required information using DBCC PAGE, and then do the updates on the production server. As always, make sure to keep a backup ready in case something goes wrong and you need to revert to an earlier copy of the database. REFERENCESFor more information about the DBCC CHECKDB statement, see
the "DBCC CHECKDB (Transact-SQL)" topic on the following Microsoft Developer
Network (MSDN) Web site: http://msdn2.microsoft.com/en-us/library/ms176064.aspx For more information about known
issues in SQL Server 2000, click the following article number to view the
article in the Microsoft Knowledge Base:
(http://msdn2.microsoft.com/en-us/library/ms176064.aspx)
900335 For more information about RPC events, see the
"Calling a Stored Procedure (OLE DB)" topic on the following MSDN Web site:
(http://support.microsoft.com/kb/900335/
)
FIX: The SQL Server 2000 automatic database recovery operation may not succeed if an index contains a FLOAT data type or a REAL data type, and this data type contains a NaN value
http://msdn2.microsoft.com/en-us/library/aa198358(SQL.80).aspx For more information about the different data types, see the
"Calling a Stored Procedure (OLE DB)" topic on the following MSDN Web site:
(http://msdn2.microsoft.com/en-us/library/aa198358(SQL.80).aspx)
http://msdn2.microsoft.com/en-us/library/ms187752.aspx For more information about floating point value conventions, visit
the following Intel Web site:
(http://msdn2.microsoft.com/en-us/library/ms187752.aspx)
http://www.intel.com/design/pentiumii/manuals/243191.htm Microsoft
provides third-party contact information to help you find technical support.
This contact information may change without notice. Microsoft does not
guarantee the accuracy of this third-party contact information.
(http://www.intel.com/design/pentiumii/manuals/243191.htm)
PropertiesArticle ID: 923247 - Last Review: March 22, 2012 - Revision: 3.0 APPLIES TO
| Article Translations
|


Back to the top








