LTRIM() Function in SQL Server Last Updated : 31 May, 2024 Comments Improve Suggest changes Like Article Like Report The LTRIM() function in SQL Server removes all the space characters found on the left-hand side of the string. It removes the leading spaces from a string, SyntaxThe LTRIM function for SQL Server syntax is: LTRIM(string, [trim_string]) Parameter: string - The string from which the leading space character would be removed. trim_string - It is an optional parameter that specifies the characters to be removed from the given string.Returns: The function will return the string after removing all left-hand side space characters. The LTRIM function is applicable to the following versions of SQL Server: SQL Server 2017 SQL Server 2016 SQL Server 2014 SQL Server 2012 SQL Server 2008 R2 SQL Server 2008 SQL Server 2005SQL Server LTRIM function ExampleLet's look at some examples of LTRIM function in SQL Server. Using LTRIM() function ExampleIn this example, we will demonstrate the basic use of the LTRIM function in SQL Server. SELECT LTRIM(' GeeksforGeeks');Output : GeeksforGeeksLTRIM() function with a variable ExampleIn this example, we will use the LTRIM function in SQL Server with a variable. DECLARE @str VARCHAR(50)SET @str = ' Have a nice time ahead!!'SELECT LTRIM(@str);Output : Have a nice time ahead!! Use of “trim_space” in LTRIM() function ExampleIn this example, we will remove specific characters from a string using the LTRIM function. SELECT LTRIM (‘000325400’, ‘0’);Output : 325400Important Points About SQL Server LTRIM functionThe LTRIM() function in SQL Server stands for “left trim” and is used to remove leading spaces (whitespace characters) from a text string.It can also be used to remove specific characters from a string.It helps in cleaning data by removing unnecessary spaces at the beginning of a string. Comment More infoAdvertise with us Next Article LTRIM() Function in SQL Server V vanshgaur14866 Follow Improve Article Tags : SQL DBMS-SQL SQL-Server Similar Reads LOG() Function in SQL Server The LOG() function returns the logarithm of a specified number or the logarithm of the number to the specified base. Syntax : LOG(number, base) Parameter : LOG() function accepts two-parameters as mentioned above and described below. number - This parameter hold a number which is greater than 0. bas 1 min read MAX() Function in SQL Server MAX() : This function in SQL Server is used to find the value that is maximum in the group of values stated. Features : This function is used to find the maximum value.This function comes under Numeric Functions.This function accepts only one parameter namely expression. Syntax : MAX(expression) Par 2 min read MIN() Function in SQL Server MIN() : This function in SQL Server is used to find the value that is minimum in the group of values stated. Features : This function is used to find the minimum value.This function comes under Numeric Functions.This function accepts only one parameter namely expression. Syntax : MIN(expression) Par 2 min read Scalar Function in SQL Server Pre-requisites: Categories of SQL Functions In SQL Server, a scalar function is a type of user-defined function that returns a single scalar value based on the input parameters passed to it. The scalar function is used to perform some calculations or operations on the input parameters and return a s 2 min read NULLIF() Function in SQL Server NULLIF() function in SQL Server is used to check if the two specified expressions are equal or not. If two arguments passed to a function are equal, the NULLIF() function returns Null to us. NULLIF() function operates like a Like a CASE Statement. It will return the value of the first argument if th 3 min read Like