The concat function was first introduced to SQL Server 2012, so prior versions of SQL need to use the + operator to concatenate strings.
select null + ' some ' + 'text' select concat(null, ' some ' ,'text')
Is concat better performance than +?
When using SQL 2012 or above you have the choice to use either + or concat. The recommended option is to use the concat function.
The reason is that the syntax is easier to follow, and the code generally cleaner. As far as actual performance goes, we have not uncovered any difference between the two methods.
Example of SQL Concatenation with +
Here is a basic example of concatentation using the + operator.
SELECT 'This ' + 'is' + ' concatenation'
Example of concatenation with concat function in sql
To do the same thing with the concat keyword is simply..
SELECT concat('This ','is',' concatenation')
Error ‘concat’ is not a recognized built-in function name.
That is the error that you get, when you try to run the concat function on SQL2008 or below.
As the function does not exist, you are going to get that error!