I'm trying to insert the following string, as written, into a table:

'affinity mask', 0

However I can't figure out how exactly I need to escape the quotes. It always wants to treat the , 0 as a separate column.

How can I escape the comma properly?

1 Answer 1


You need to double-up apostrophes to embed them within a string, since they also serve as string delimiters:

INSERT dbo.table(column) VALUES('''affinity mask'',0');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.