SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

New string functions in SQL Server 2017

By Jayendra Viswanathan,

mj 89387 : "concatanate" is updated as "concatenate".
1.  CONCAT_WS is simple to use function in new SQL Server 2017. We shall see some short examples to understand it better. The purpose of the function is to concatenate the columns with a delimeter. Below are the sample :
Below is the output on example CONCAT_WS

2. TRANSLATE is used to translate the given characters with the new character set for a given string. Below is the output on example TRANSLATE 

3. TRIM is used remove spaces as default and/or we can remove other specified characters from start or at the end of string. Below is the output on example TRIM 

We shall remove the * which is precent at the begening of the data. Below is the output on example TRIM 

We saw three SQL Functions - CONCAT_WS , TRANSLATE and TRIM with examples.

Total article views: 511 | Views in the last 30 days: 10
Related Articles

Unable to translate Unicode character

Unable to translate Unicode character


SQL Server 2017+ How To Replace Multiple Characters In A Single Statement With TRANSLATE

The REPLACE function in SQL Server has until now been quite limited. SQL Server 2017 has introduced ...


Linker server to AS/400 DB2 - character translation problems

LinkeD server returning garbage for special characters on AS/400 DB2


Inserting UniCode / Special characters in tables

Consider the situation where one needs to store multilingual data / Special characters into a tabl...


Translating reports with Analysis Services and MS-Excel

Translating reports with Analysis Services 2012 and MS-Excel 2013 in a multilingual environment