How to concatenate string

To concatenate a string uses sql concat function.

Syntax

expression + expression

expression += expression

CONCAT ( expression,expression )


Examples

SELECT 'abc'+'123';

SELECT CONCAT('abc','123');

SELECT ID, NAME + ' - ' + JOB FROM EMPLOYEES;

DECLARE @var_string varchar(100);
SET @var_string = 'String A.';
SET @var_string += ' String B.';
PRINT @var_string;