1

I am getting error in microsoft sql server because the data I want to update is contains (') symbol in the data.

update Employee_table
set
brokername='Angie's Broker',
where ID=7788;

Please someome resolve the problem.

ambuj151
  • 39
  • 5

3 Answers3

0

For single quotes used inside a string literal, you put another single quote before it. This is called "escaping" the single quote, and different sorts of escaping are quite usual in programming:

update Employee_table
set
brokername='Angie''s Broker',
where ID=7788;
George Menoutis
  • 6,894
  • 3
  • 19
  • 43
0
   UPDATE Employee_table SET brokername = 'Angie''s Broker' WHERE id = 7788;

To update a table column that contains the single quote symbol ('), you can use the escape sequence ('') to represent the single quote in the data.

0

Another way to escape the single quote is to use the unicode char like below :

update Employee_table
set brokername='Angie' + CHAR(39) + 's Broker',
where ID=7788;
Md. Suman Kabir
  • 5,243
  • 5
  • 25
  • 43