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

Rtrim doesn't work with Update

Status
Not open for further replies.

andreis

Programmer
Joined
Apr 19, 2001
Messages
169
Location
US
Hi:

I'm converting data from Btrieve, and, being already in SQL Server 2000 through ODBC, I try to trim char field:
Update Source
set [Last_Name] = rtrim([Last_Name])

SQL reports success, but doesn't do the thing. This statement, though, is working:

Select rtrim([Last_Name]) into #temp from Source

I have huge tables that hard to select into their replicas only to solve the trimming problem.

Any suggestions?

Thanks.
Andrei
 
What is the datatype of Last_Name in the SQL Server database?

SQL Server always fills datatypes of CHAR() with spaces, nothing you can do about that. Maybe VARCHAR() would work better for Last_Name, once you trim the trailing spaces they will be gone for good.
 
rac2:

Thank you very much, you solved my puzzle. It was char indeed.

Andrei
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top