Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 Other Topics
 edit data in the table

Author  Topic 

nema
Starting Member

3 Posts

Posted - 2005-08-15 : 00:52:41
sql generates an error everytime i edit a value in one column of the table that i created: "The value you entered is not consistent w/ the data type or length of the column" even if the value i enter is less than the length of that column.

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2005-08-15 : 01:21:35
How are you trying to insert the data?
Go to Top of Page

nema
Starting Member

3 Posts

Posted - 2005-08-15 : 02:26:33
i have to 2 columns w/ datatype char named FranCode & FranDesc set at length 3 and 30 respectively.If i edit the value of the FranDesc column then that error would appear. I notice that if i delete the spaces in that edited column there's no more error. i insert and edited data directly in sql table.
Go to Top of Page

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2005-08-15 : 12:14:21
You are getting hit with spaces to the right of your regular data...and you are (inadvertently) inserting more data than the column can hold.
Go to Top of Page

nema
Starting Member

3 Posts

Posted - 2005-08-16 : 00:40:11
thanks guys for the inputs. but what i did to correct the error was to changed the datatype from char to nvarchar. I noticed that when i used the char datatype in the sql table if the size is 30, there's an blank spaces already appended after the actual value. when i tried editing directly on the table or even using the vb program, the blank spaces were not replaced w/ the value so that's why there's an error .
Go to Top of Page

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2005-08-16 : 06:50:57
"char to nvarchar"
unless you need internationalision...ie funny (non english) character sets, chinese, japanese, arabic, etc...then you need only do "char to varchar"

the 'n' bit deals with double-byte character sets....and has operating implications of it's own.
Go to Top of Page

meehanj2
Starting Member

2 Posts

Posted - 2009-05-29 : 10:04:10
In relation to this issue, how can you increase the number of allowed characters in a column?
Go to Top of Page
   

- Advertisement -