Problem solve Get help with specific problems with your technologies, process and projects.

Avoid errors in insert queries

When you execute insert queries with the ' charecter as part of the text portion, it will give you an error. Here's how to get around that.

Please let other users know how useful this tip is by rating it below. Do you have a tip or code of your own you'd like to share? Submit it here.


When you execute insert queries with ' charecter as part of the text portion, it will give you an error. To get around this problem, you can use replace function to convert this single ' to a set of ''.

variablename = replace(replace(variablename,"'","''"),chr(13),""""))

Dig Deeper on Win Development Resources

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchCloudComputing

SearchSoftwareQuality

TheServerSide.com

Close