Insert Query for HTML string in SQL

14,963

You have error in using " inside the third inserted value

INSERT INTO 
   QUESTION (QuestionType,QuestionID,QuestionTitle) 
VALUES ('MRQ',
        'QNB5T6TKDMS',
        '<p><span style="font-family: comic sans ms,sans-serif; font-size: small;">
         what was the original concentration of the acid?</span></p>'
       );

You can also use escape slashes

Share:
14,963
pallavi_ios
Author by

pallavi_ios

Updated on June 17, 2022

Comments

  • pallavi_ios
    pallavi_ios almost 2 years

    I have Sql database with table name QUESTION.

    I want to insert value for QuestionTitle as html string. Insert query is

    INSERT INTO 
       QUESTION (QuestionType,QuestionID,QuestionTitle) 
    VALUES ("MRQ",
            "QNB5T6TKDMS",
            "<p><span style="font-family: comic sans ms,sans-serif; font-size: 
    small;">what was the original concentration of the acid?</span></p>")
    

    When I try to execute this query in Sql it gives an error . How can I do this so that it will work for html string.