I am using SQL Server 2008 R2 and am trying to run the following command:
SELECT CustCity AS City, Concat(CustLastName, \', \', CustFirstName) AS Customer
FROM Customers
ORDER BY CustCity, Customer
The error message I am receiving is:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near ', \'.
As far as I have learnt, this is how Concat should work so I don't understand why this is not working.
Can anyone help?
CONCATis a NEW function in SQL Server 2012 and doesn't exist in earlier versions, \'instead of, '\'?