EN
MS SQL Server - CONCAT() function example
0 points
In this article, we would like to show you CONCAT()
function example in MS SQL Server.
Quick solution:
xxxxxxxxxx
1
SELECT CONCAT('expression1', 'expression2', 'expressionN')
2
AS [alias_name];
or:
xxxxxxxxxx
1
SELECT 'expression1' + 'expression2' + 'expressionN'
2
AS [alias_name];
In this example
Query:
xxxxxxxxxx
1
SELECT CONCAT('Simon', ' ', 'Collins', ' ', '987-654-321')
2
AS 'phone_contact';
Result:

Note:
CONCAT()
function can be also used to merge values or search many columns. Go to this article to see more complex examples.