I want to update a column in SQL Server by keeping its original value and appending new value separated by comma. It can be done like this:
string sql = "UPDATE Table SET Column = Column + ', Test' WHERE ID = 1";
How can I do the same using SqlParameter
if I have something like:
string sql = "UPDATE Table SET Column = @ColumnParameter WHERE ID = 1";
command.Parameters.Add(new SqlParameter("@ColumnParameter", "Test"));
Something like.
string sql = "UPDATE Table SET Column = concat(Column, ', ', @ColumnParameter) WHERE ID = 1";