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'

Answers


update "table"
   set field = '''ttttt'', ''kkkk'', ''mmmmmm'''
where id = 1
;

UPDATE Table
SET FIELD = 'ttttt\', \'kkkk\', \'mmmmmm'
WHERE ID = 1

OR

UPDATE Table
SET FIELD = 'ttttt'', ''kkkk'', ''mmmmmm'
WHERE ID = 1

Need Your Help

Setting visibility of MenuItems issue

android android-actionbar android-viewpager android-optionsmenu menu-items

I'm trying to set different MenuItems to each of my app's tabs (ActionBar Navigation Tabs). I've tried many solutions but the last seems to be the closest. When i open my app it hides my MenuItem ,...

How to remove SharedPreferences from Array

android

I have problem with removing items from ArrayList. I tried it maybe 100 times but I can't fix it. Saving to list isn't problem but it's very hard to remove for me.