Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

Returns a character string after truncating all trailing blanks.

RTRIM (character_expression )


An expression of character or binary data, or other data types that are implicitly convertible to nvarcharor ntext. Otherwise, use CONVERT to explicitly convert character_expression.

nvarchar or ntext

The following example removes trailing blanks from the names of customers listed in the MyCustomers table.

CREATE TABLE MyCustomers (CustID INTEGER IDENTITY (100,1) PRIMARY KEY, CompanyName nvarchar (50))
INSERT INTO MyCustomers (CompanyName) VALUES ('A. Datum Corporation   ')
SELECT CustID, RTRIM(CompanyName)
FROM MyCustomers
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft