Category Archives: Database

insert single quotes – mssql

You enclose strings in single quotes when you are inserting strings in a table on a mssql server. But when the string contains ‘ (single quotes) and you are not using something like a prepared statement(let’s say you wanna make a manual insertion) how would you do it? Simple. Use the single quotes twice. i.e

insert into table_name(string_column) values ('how're you?')

would become

insert into table_name(string_column) values ('how''re you?')

Cheers. 🙂