bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL Server CONCAT() Function

Concept visual

SQL Server CONCAT() Function

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

Example

Add two strings together:

Select

CONCAT('W3Schools', '.com');

Definition and Usage

The CONCAT() function adds two or more strings together.

Note:

See also

Formula

Concat with the + operator and

CONCAT_WS().

Syntax

Concat(

string1, string2,...., string_n )

Parameter Values

Parameter

Description string1, string2, string_n Required. The strings to add together

Technical Details

Works in:

SQL Server (starting with 2012), Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse

More Examples

Example

Add 3 strings together:

Select

CONCAT('SQL', ' is', ' fun!');

Example

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

Select

CONCAT('SQL', ' ', 'is', ' ', 'fun!');

Previous

❮ SQL Server Functions

Next

Previous

SQL Server CHARINDEX() Function

Next

SQL Server Concat With +