Home:ALL Converter>Concatenating String in SQL Server 2005

Concatenating String in SQL Server 2005

Ask Time:2009-12-04T13:37:37         Author:Chin

Json Formatter

Does anyone know how I would go about concatenating a string in SQL Server 2005.

What I mean is something like the following scenario.

I have a nvarchar(MAX) column in a SQL Server 2005 database.

Lets say the column has a value of "A" and I want to add "B" making "AB", what is the simplest way to go about this. Will I need to do a Select, concatenate the two values in code and then update the column? Or is there a more nifty way to do this?

Any pointers much appreciated.

Author:Chin,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/1845066/concatenating-string-in-sql-server-2005
FlySwat :

In T-SQL:\n\n UPDATE table SET col = col + 'B' WHERE (PREDICATE THAT IDENTIFIES ROW)\n\n\nIf you were using Oracle it would be:\n\n UPDATE table SET col = col || 'B' WHERE (PREDICATE THAT IDENTIFIES ROW)\n",
2009-12-04T05:54:57
yy