12 Jan’18

BISQL Server 2017 | New function : TRIM

TRIM Function has haunted SQL DBA for ages. If you have been using SQL Server for a while, you will totally agree with me over here. In this blog post we will see how the new feature TRIM of SQL Server 2017 works in few simple words.

SQL Server DBAs and Developers have always dealt with SQL Strings and the leading and trailing spaces often makes them crazy. Data query may not be at it’s best if there are leading spaces around strings and which are not useful for data comparison and well as storage point of view.

In the previous server versions developers used to two different functions LTRIM and RTRIM around the string to get necessary results. However now in SQL Server 2017 we have a new feature introduced which is TRIM(). This function works just like LTRIM and RTRIM together.

Sql Server Trim function

When you run above script you can see that when we use function TRIM around the string it removes leading and trailing spaces. Trim function is combination for LTRIM & RTRIM, and only available in SQL server 2017.

For earlier version, LTrim and RTrim is available.

Written by

Jayant Patel

Sr. Software Developer

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Design Views in App Designer – D365

    11 April’ 2018

    Introduction: Create and edit public or system views by using the app designer Description: Dynamics 365 sales app des...

    Read more
  • Call Management in D365 Field Service

    10 April’ 2018

    Introduction: This blog provides a solution to requirement of Client for Call Management in D365 Field Service. Scenari...

    Read more
  • Fetch Hierarchical data for Product Category in Dynamics 365 Operations

    10 April’ 2018

    Introduction: In this blog article, we will see how we can fetch hierarchical data using X++. How to fetch? We will ta...

    Read more
  • PowerBI April 2018 Update: Combo Chart Line Formatting

    10 April’ 2018

    Introduction: PowerBI introduced the feature to format line styles and legends for line charts a while ago. However, th...

    Read more
  • Power BI April 2018 Update: Q&A Explorer

    10 April’ 2018

    Introduction: In this blog we will explore some of the new features added to Power BI. Power BI has upgraded its Q&...

    Read more