SQL Server: columns that leave spaces in it

I have a problem with a database hosted in Microsoft SQL Server 2008 R2.

I made a table with some varchar(length) columns.

The problem is that when I insert something into it, it leaves “spaces” at the end of the column, ruining everything.

So the columns look something like this:

 some_value _________ 

( __ = spaces)

Sometimes spaces are even longer ...

And I can’t delete them, because even when they are deleted, they return to their place.

What is the problem?

Too high varchar(length) ?

The fact is, I can’t set it shorter because the value that I am going to insert into the table is not fixed in length.

Any fix?

+4
source share

All Articles