Export (0) Print
Expand All

RTRIM

SQL Server 2000

Returns a character string after truncating all trailing blanks.

Syntax
RTRIM ( character_expression ) 
Arguments
character_expression
Is an expression of character or binary data, or other data types that are implicitly convertible to nvarchar or ntext. Otherwise, use CAST to explicitly convert character_expression.
Return Types

nvarchar or ntext

Examples

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

Show:
© 2015 Microsoft