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

RTRIM not working!?

Status
Not open for further replies.

Gooser

Technical User
Jun 28, 2006
803
US
I have data that includes several trailing spaces. When I run the following query against it, it says "(735 row(s) affected)", but it isn't getting rid of the spaces. Any ideas?

Code:
 UPDATE [Inspections].[dbo].[ProtectionUnit]
    SET [UnitNm] = RTRIM([UnitNm])

The data originated from an Access database, if that is of any help in solving the mystery.

Thanks,
v/r
Gooser
 
Is the field type CHAR by chance??? CHAR will insert spaces back in to fill the field to the length. VARCHAR will not do this...

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB.NET Programmer
 
You can see the data type with this:

Code:
Select Data_Type 
From   Information_Schema.Columns
Where  Table_Name = 'ProtectionUnit'
       And Column_Name = 'UnitNm'


-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top