concatenation against INTEGER values

Bandi
Posted by Bandi under Sql Server category on | Points: 40 | Views : 235
There is some differences between Plus operator's concatenation and CONCAT() function.

SELECT CONCAT(1, 2, 3, 4) AS IntegersCONCAT
SELECT 1+2+3+4 as IntegersPlusOperation


Output:

IntegersCONCAT
1234

IntegersPlusOperation
10



Plus operator will do the addition operation against the integer operands; where as CONACT considers each operand as Strings.. so it resulted '1234' as output

Comments or Responses

Login to post response