Ask Your Question
4

What is the best way to insert text with special characters, such as "Makin' Plans," into SQL?

asked 2021-10-29 11:00:00 +0000

lalupa gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-10-12 13:00:00 +0000

devzero gravatar image

The best way to insert text with special characters into SQL is to use single quotes to enclose the text. In the case of "Makin' Plans," the SQL statement would be:

INSERT INTO tablename (columnname) VALUES ('Makin'' Plans')

Note the use of two single quotes to represent the single quote within the text. This approach will work for any text that includes special characters, including double quotes, backslashes, and other characters that can cause issues when inserted directly into SQL.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-10-29 11:00:00 +0000

Seen: 14 times

Last updated: Oct 12 '22