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.
Author |
Topic |
sqlferns
Starting Member
8 Posts |
Posted - 2008-07-15 : 18:09:17
|
I have a text data stream that gets parsedto a 1000 character VARCHAR column. Most of the columns end up being 1000characters. But, one is only 999 (not the last one). For some reason, thelast character is being truncated, it is a space. I haven't look at the 1000character rows to see if they have 1 or more trailing spaces. |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
sqlferns
Starting Member
8 Posts |
Posted - 2008-07-15 : 20:36:37
|
The 12th segment (1000 characters) is sent to the database as 1000 characters,but the database only contains 999. The last space in the segment is trimmed. This causes the schema to be invalid in this case.So what could be the reason |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-16 : 10:03:14
|
quote: Originally posted by sqlferns I have a text data stream that gets parsedto a 1000 character VARCHAR column. Most of the columns end up being 1000characters. But, one is only 999 (not the last one). For some reason, thelast character is being truncated, it is a space. I haven't look at the 1000character rows to see if they have 1 or more trailing spaces.
Are you using some trimming functions or applying any other string functions while populating string values to table? Posting you current might help us. |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-07-16 : 10:16:08
|
Use CHAR(1000) as datatype instead of VARCHAR(1000) which automatically trims trailing spaces, whereas CHAR keeps trailing spaces ( and even inserts spaces if missing!). E 12°55'05.25"N 56°04'39.16" |
 |
|
|
|
|