Update Field with Special Character ' (single quote)
I am workign with SQL Server 2008 and have to update one field (FIELD_NAM) which contains values of this format:
- First value in the field: 'abc', 'efg', 'xyz'
- Second value in the field: 'aaaaa', 'bbbb', 'vvvvvv'
I tried with the following statement:
UPDATE Table SET FIELD = 'ttttt', 'kkkk', 'mmmmmm' WHERE ID = 1
(only one row and one field/column has to be updated) The error I got is
Incorrect syntax near 'ttttt'
update "table" set field = '''ttttt'', ''kkkk'', ''mmmmmm''' where id = 1 ;
UPDATE Table SET FIELD = 'ttttt\', \'kkkk\', \'mmmmmm' WHERE ID = 1
UPDATE Table SET FIELD = 'ttttt'', ''kkkk'', ''mmmmmm' WHERE ID = 1