question

goza1515 avatar image
goza1515 asked

Update Data in table with double and single quotes

I am trying to add the following message to my db and some is showing red some showing green i need the whole message with quotes to be entered. update ResponseMessages set message = 'One of the criticisms of the so-called charity "watchdog" agencies is their one-size-fits-all approach. These agencies assume that all charities are similarly situated and can raise funds at similar costs, through similar methods. This is not always true. The remote location of St. Labre has a direct impact on how we are able to raise funds and the cost of doing so. Further, the watchdog agencies' ratings are actually a measure of a charity's efficiency in raising funds, not a measure of the effectiveness of the charity's programs.'
updatelearning
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Alvin Ramard avatar image
Alvin Ramard answered
If you could replace each single quote within the message with 2 single quotes then your update statement should work.
3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I need the Double quote around "watchdog" to be imported. any ideas how to keep that double quoted.
0 Likes 0 ·
Adding: SET QUOTED_IDENTIFIER ON before your update statement should preserve the double quotes.
0 Likes 0 ·
Since the double quotes are within a string literal that is delimited by single quotes, they require no special treatment.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.