Thursday, December 6, 2012

How do I escape single quotes in SQL queries?

INVALID:

SELECT * FROM TableName WHERE FieldName = 'QueryString's Value'

VALID:

SELECT * FROM TableName WHERE FieldName = 'QueryString''s Value'

No comments:

Post a Comment