0

In SSIS I have an email address stored in a variable. The person's name in the email address has a single quote which is confusing sql server.

Something such as

    Select field1, field2, from mytable where cust_emlad_tx = ?

cust_emlad_tx contains a name such as Jim.O'Dowell@something.com

How could I replace that with two single quotes so that sql server will process it?

Thanks

Rachel Gallen
  • 27,943
  • 21
  • 72
  • 81
  • Can you clarify what "confusing SQL Server" actually means? Using variables usually avoids issues with quoting, so it's not clear what the problem really is. – Pondlife Feb 14 '13 at 21:55

1 Answers1

0

Something that might help you with the single quotes. The general practice is to replace the single quote with 2 single quotes and that does not confuse the SQL Server when processing the strings.

Community
  • 1
  • 1
rvphx
  • 2,324
  • 6
  • 40
  • 69