RTRIM(Transact-SQL)
SQL Server 2005
후행 공백을 모두 잘라낸 문자열을 반환합니다.
호환성 수준은 반환 값에 영향을 줄 수 있습니다. 자세한 내용은 sp_dbcmptlevel(Transact-SQL)을 참조하십시오.
다음 예에서는 RTRIM을 사용하여 문자 변수에서 후행 공백을 제거하는 방법을 보여 줍니다.
DECLARE @string_to_trim varchar(60); SET @string_to_trim = 'Four spaces are after the period in this sentence. '; SELECT @string_to_trim + ' Next string.'; SELECT RTRIM(@string_to_trim) + ' Next string.'; GO
결과 집합은 다음과 같습니다.
------------------------------------------------------------------------- Four spaces are after the period in this sentence. Next string. (1 row(s) affected) ------------------------------------------------------------------------- Four spaces are after the period in this sentence. Next string. (1 row(s) affected)
