I am trying to run a query like
UPDATE myTable SET Name='B&L' WHERE ID = 1;
The problem is I am getting the following error:
Unclosed quotation mark after the character string ‘B’.
My column is of type varChar and as you can see I am escaping the string with ‘quotes’. How can I get the & symbol to insert?
Thanks.
For MSSQL try escaping the
&by enclosing it in square brackets so it would become:Or you could use the
ESCAPEstatment like so: