Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pass a special character in an SQL statement 1

Status
Not open for further replies.

benmillus

Programmer
Jun 17, 2003
18
US
For example, "UPDATE tableName SET [tableName].fieldMessage = 'OTC's Not Covered' WHERE [tableName].fieldNameID1='0403REJ' and [tableName].fieldNameID2='0008';"

Need to update "fieldMessage" with the value "OTC's Not Covered". But the value contains the ' character and SQL does not interpet it as part of the value.

Any ideas?
 
Code:
UPDATE tableName 
   SET fieldMessage = 'OTC''s Not Covered' 
 WHERE fieldNameID1='0403REJ' 
   and fieldNameID2='0008'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top