Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

extra space added

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
US
I am having extra space added to values that I am inserting via asp. I am checking them with hidden inputs right before they are inserted and they look ok but when I see them in the db they have extra space added:

<input type=&quot;hidded&quot; value=&quot;123&quot;>

insert into ... (colName) values ('&quot;&varName&&quot;')

creates:
123(with about 5 spaces after)

thanks
 
The fields have probably been defined as
CHAR(10)
rather than
VARCHAR(10)

Char (10) will always create a field that is 10 characters long. This will be filled with spaces if the fields is actually chorter than 10 Character.

VARCHAR(10) will hold any number of characters upto 10.

Hope this helps,

Chris Dukes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top