February 21, 2017 at 1:53 pm
hi.
i need to update the column data with ' mark
can any one provide the code
update Person Set First = O'Brien
where id =22
i am getting syntax error
February 21, 2017 at 1:59 pm
You need to use single quote twice.
O''Brien
Michael L John
If you assassinate a DBA, would you pull a trigger?
To properly post on a forum:
http://www.sqlservercentral.com/articles/61537/
February 21, 2017 at 1:59 pm
Arjun SreeVastsva - Tuesday, February 21, 2017 1:53 PMhi.i need to update the column data with ' mark
can any one provide the code
update Person Set First = O'Brien
where id =22i am getting syntax error
O'Brien is a string, so it should go in quotes. To escape a quote mark, you just add a second one.
update Person Set First = 'O''Brien'
where id =22
February 21, 2017 at 2:00 pm
the single quote is SQL's delimiter for identifying strings, so you have to escape it by repeating it twice in a row, where you want it to exist inside your stringupdate Person Set First = 'O''Brien'
where id =22
Lowell
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply