THE WORLD'S LARGEST WEB DEVELOPER SITE

SQL Server CONCAT() Function

❮ SQL Server Functions

Example

Concatenate strings together:

SELECT CONCAT('W3Schools', '.com');
Try it Yourself »

Definition and Usage

The CONCAT() function is used to concatenate two or more strings together.

Note: See also Concat with the + operator.

Syntax

CONCAT(string1, string2, ...., string_n)

Parameter Values

Parameter Description
string1, string2, string_n Required. The strings to concatenate

Technical Details

Works in: SQL Server 2014, SQL Server 2012

More Examples

Example

Concatenate strings together:

SELECT CONCAT('SQL', ' is', ' fun!');
Try it Yourself »

Example

Concatenate strings together (separate each string with a space character):

SELECT CONCAT('SQL', ' ', 'is', ' ', 'fun!');
Try it Yourself »

❮ SQL Server Functions