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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trim Varchar Columns Trailing Spaces

Status
Not open for further replies.

Auguy

Programmer
May 1, 2004
1,206
US
New to MySql, is there a setting to force all varchar columns to trim trailing spaces? It looks like it used to be automatic in older versions, but I can't find anywhere to set this as a default.

Auguy
Sylvania/Toledo Ohio
 
UPDATE table SET column = TRIM(column);

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Thanks, but do you know how to do it in a .Net dataadapter commmand like this
Code:
command.Parameters.Add("@FirstName", MySqlDbType.VarChar, 15, "FirstName")
I've tried adding Trim in various ways to this code, by can't seem to make it work.

Auguy
Sylvania/Toledo Ohio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top