Inserting Strings Without Trailing Spaces SQL

Posted by Soo on Stack Overflow See other posts from Stack Overflow or by Soo
Published on 2010-05-13T17:33:04Z Indexed on 2010/05/13 17:44 UTC
Read the original article Hit count: 240

Filed under:
|

I have a database with a field named Field1 that has 100 nchars per entry. Each time I add a value, it is stored as:

"value     (100-ValueLength Spaces)        "

So Basically each stored value has a string of spaces after it. This is getting to be an issue when I try doing:

if (value == "Example")

because of all of the empty spaces after the string. How can I get it so the stored values don't have all of these trailing spaces?

© Stack Overflow or respective owner

Related posts about sql

Related posts about spaces