views:

29

answers:

1

HI ALL,

I am using sql server express to store some data but it also store spaces with data. for example if a have a nchar(20) column in a table and i store "computer" (8 characters) to this column, then remaining character (20-8=12) is filled with blank spaces. Is there any way to over come this problem. Because when I shows this data to flow document (center alignment), then it produces alignment error.

Thanks for help

+7  A: 

You can use the NVARCHAR data type instead. The NVARCHAR type is a variable length data type and will only store the actual data.

If you don't have control over the data types then you'll need to trim off any extra characters manually. In T-SQL you can do this with the RTRIM command.

TLiebe
thanks for your help...
RAJ K