LTRIM(Transact-SQL)

선행 공백을 제거한 문자 식을 반환합니다.

항목 링크 아이콘Transact-SQL 구문 표기 규칙

구문

LTRIM ( character_expression )

인수

character_expression

문자 또는 이진 데이터의 입니다. character_expression은 상수, 변수 또는 열일 수 있습니다. character_expressiontext, ntextimage 데이터 형식이어서는 안 되며 암시적으로 varchar로 변환될 수 있는 데이터 형식이어야 합니다. 그렇지 않으면 CAST를 사용하여 character_expression을 명시적으로 변환하십시오.

주의

호환성 수준은 반환 값에 영향을 줄 수 있습니다. 호환성 수준에 대한 자세한 내용은 sp_dbcmptlevel(Transact-SQL)을 참조하십시오.

반환 형식

varchar 또는 nvarchar

다음 예에서는 LTRIM을 사용하여 문자 변수에서 선행 공백을 제거하는 방법을 보여 줍니다.

DECLARE @string_to_trim varchar(60)
SET @string_to_trim = '     Five spaces are at the beginning of this
   string.'
SELECT 'Here is the string without the leading spaces: ' + 
   LTRIM(@string_to_trim)
GO

결과 집합은 다음과 같습니다. 

------------------------------------------------------------------------
Here is the string without the leading spaces: Five spaces are at the beginning of this string.             

(1 row(s) affected)

참고 항목

참조

데이터 형식(Transact-SQL)
문자열 함수(Transact-SQL)

도움말 및 정보

SQL Server 2005 지원 받기