Column "pobs_name" value is out of range for data type "varchar". Update column to a legal value

  • Digging around some more, wanted to share what I found:

    Using this link - http://support.microsoft.com/kb/923247

    I did a DBCC PAGE on the affected pages and went to the specific slot that reported an issue. Then I was able to find the pobs_id of that row and could do a SELECT against the table and see the 'bad data':

    DBCC PAGE ( pmdb_cn , 1 , 110117 , 3 )

    Slot 38 Column 3 Offset 0x3c Length 255 Length (physical) 255

    pobs_name = INVALID COLUMN VALUE

    select * from POBS where pobs_id=6932

    ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

    So it looks like i have 4 rows where the data is unicode (Chinese characters) and cannot fit into this column.

    I'm thinking that the datatype of the column should be NVARCHAR not VARCHAR in order to accept these values and be compatible with unicode characters. The db collation is Chinese so i *think* this column should be set to nvarchar..thoughts?

  • You need to update the column to legal values, consider altering the column later. But there's no guarantee that that is even a legal unicode string. Somehow invalid values have crept in, who knows what that was or is supposed to be.

    btw, repair can't fix data purity errors. You need to manually update the affected rows to valid values.

    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
  • GilaMonster (7/15/2014)


    You need to update the column to legal values, consider altering the column later. But there's no guarantee that that is even a legal unicode string. Somehow invalid values have crept in, who knows what that was or is supposed to be.

    btw, repair can't fix data purity errors. You need to manually update the affected rows to valid values.

    Right, I think the presence of question marks in the data indicate invalid values (hence SQL turning them into question marks), correct? Or values where the original data was a Unicode character that cannot be imported/non-compatible with the database collation..?

    I will go back to the application admin to ask for valid values to be entered.

  • It's invalid values (not varchar data) that due to some bug somewhere has snuck into the table. That's about all you can say.

    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

Viewing 4 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply