Articles in this section
Category / Section

How to use the TRIM in SQL Server 2016 and below

Published:

Problem

During the process of creating expressions in Bold BI, there may be instances where you encounter an issue such as “TRIM is not recognized as a built-in function name” when using a SQL Server data source.

image.png

Reason

  • TRIM() function is not supported in SQL Server 2016 and earlier versions
  • This implies that if you attempt to use the TRIM function in SQL 2016 or earlier, you will encounter an error message stating, “TRIM is not a recognized built-in function name.”

Solution

  • SQL Server 2016 or earlier uses the LTRIM function to remove spaces or characters on the leading (left) side of a string and RTRIM to remove them on the trailing side (right).

    Example:

        SELECT RTRIM(LTRIM([column])) AS TRIM_VALUE from [Table_name];
Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
SM
Written by Siranjeevi Murugan
Updated
Comments (0)
Please  to leave a comment
Access denied
Access denied