The information in this article applies to:
SUMMARY
This article shows how to place text strings into a SQL Server table that
contain embedded single quotes. When placing a text string into a SQL
Server table that contains an embedded single quote, a second single quote
must be placed adjacent to it. If this is not done, SQL Server assumes that
the text string ends at the first single embedded quote causing an error
similar to:
For example: The word "Don't" must be formatted 'Don''t' to be inserted correctly into a SQL Server table. The two single quotes adjacent to each other is interpreted by SQL Server as one single embedded quote. MORE INFORMATION
The following function (written in VBScript) will format and return any
string sent to it with the appropriate quoted format.
REFERENCES
For additional information, please see the following article(s) in the
Microsoft Knowledge Base:
Q152620 BUG: Inserting to a 255-byte String w/ Embedded quot Additional query words:
Keywords : kberrmsg kbADO kbASP kbDatabase kbScript kbSQLServ kbGrpASP kbCodeSnippet kbiis400 kbiis500 |
Last Reviewed: December 8, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |