Try NVARCHAR instead of NCHAR.
Guillaume
2009-07-28 15:08:01
You're using an nchar(255)
, which is a static length of 255. Try changing the column to nvarchar(255)
.
An nchar(255)
will always give you 255 characters. Those that aren't used are filled in by whitespace (0x20 in ASCII aka a space). nvarchar(255)
will allocate 255 characters when initialized, but only use the characters necessary.
In this case, you want nvarchar(255)
, since you have a variable-length string.
NCHAR is a fixed length field. Using NVARCHAR as your data type would keep you from getting the spaces.