t-sqlsql-server-2014

Is there any difference between LTRIM(RTRIM(MyColumn1)) and TRIM(MyColumn1)?


Is there any difference between these two?

LTRIM(RTRIM(MyValue1))

TRIM(MyValue1)

I see a lot of examples that use LTRIM(RTRIM(MyValue1)), but my understanding is that this is equivalent to TRIM(MyValue1).

Am I missing something here (or was TRIM() introduced just recently which resulted in all of the examples that use LTRIM/RTRIM)?

Thank you in advance.


environment: SQL Server 2014 standard edition


Solution

  • https://learn.microsoft.com/en-us/sql/t-sql/functions/trim-transact-sql?view=sql-server-2017

    TRIM() was introduced in SQL Server 2017.