Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

char length

Status
Not open for further replies.

ikim2000

MIS
May 23, 2002
22
CA
I have defined a datafield as "char" type and the length at 50. However, when I'm entering data that is less than 50 characters, I keep getting an error message "The value you entered is not consistent with the data type length of the column".

I did originally did have the data length defined at 10, but I later expanded to 50. It appears that SQL2000 is not allowing me to reenter my data exceeding 10 chars for the data that I entered before making a change to the data length.

How do I correct this?

Thanks,
Ik

 
How are you updating the table - Enterprise Manager, Access, another product? Are you accessing the table directly or a view? Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
I was trying to modify the data directly into the data field by accessing the table from the Enterprise Manager.

I selected the table and returned all rows and I tried to modify...


Thanks,
Ik
 
I think that's because char columns are padded with blanks (thus filling the column with a full 50 characters. When you try to insert new characters, the blanks actually count as characters, so you end up with 'more than 50' counting your new ones.

When doing this in EM like you are, you need to delete some blanks at the end - at least as many as the characters you plan to add.

I dunno, that's what I think this is.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top