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

LTRIM and RTRIM Trimming Functions (Level 2)

LTRIM and RTRIM Trimming Functions (Level 2)
SQL Server 6.x SQL Server 2000
The LTRIM and RTRIM functions returned NULL in queries using zero-length strings:
SELECT RTRIM('')

SELECT DATALENGTH(RTRIM(''))
Zero-length strings are supported. The queries shown return nonnull values; the first returns '' and the second returns 0.

Expect different results as compared to earlier versions of SQL Server. LTRIM and RTRIM provide different output from earlier versions of SQL Server.


Show:
© 2015 Microsoft