Logo

CONCAT

Updated 2023-11-10 14:31:57.613000

Syntax

SELECT [westclintech].[wct].[CONCAT] (
  <@Text1, nvarchar(max),>
 ,<@Joiner, nvarchar(max),>
 ,<@Text2, nvarchar(max),>)

Description

Use the scalar function CONCAT function to concatenate the contents of 2 columns.

Arguments

@Text1

is the first text value to be concatenated. The @Text1 argument can be of data types that are implicitly convertible to nvarchar or ntext.

@Joiner

is the text value that connects @Text1 to @Text2. The @Joiner argument can be of data types that are implicitly convertible to nvarchar or ntext.

@Text2

is the text value that connects @Text1 to @Text2. The @Joiner argument can be of data types that are implicitly convertible to nvarchar or ntext.

Return Type

nvarchar(max)

Remarks

CONCAT automatically converts input values to strings.

CONCAT can be called iteratively to build up longer strings.

Examples

select 123 + '' + 456;

This produces the following result.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"579"}]}
select wct.CONCAT(123, '', 456);

This produces the following result.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"123456"}]}