How to Use CONCAT() function in Sql Server

Sql CONCAT() function 

The CONCAT function introduced  in SQL Server 2012, This function concatenating two or more string values and returns a string value.

Syntax:

CONCAT( string1, string2 ,.....stringN)

Exapmle:-  Following is "EMPLOYEE" table where  i am going to apply the CONCAT function



Id
Name
Age
1
Alok Kumar Singh
30
2
Tomas Paul
45
3
Cristomfer Dee
85
4
Niel Macengi
55


SELECT CONCAT(NAME,'-',ADDRESS,'-',AGE) AS EMPDetail FROM EMPLOYEE

Result:-

EMPDetail
Id
Alok Kumar Singh -IN-30
1
Tomas Paul-NZ-45
2
Cristomfer Dee-AU-85
3
Niel Macengi-US-55
4





How to Use CONCAT() function in Sql Server How to Use CONCAT() function in Sql Server Reviewed by Alok Singh on 01:36 Rating: 5
Powered by Blogger.