Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Handling single quotes inside text
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00486527
Message ID:
00486610
Vues:
9
Hi Terry,
>If a person submits text like the following:
>
>"John's Steakhouse" as a company name, how would I handle it before inserting that text into a text or char or varchar type field so as to not confuse SQL Server while still keeping the intent of the end user and their formal companies name?

If you double the single quote you will get the desired result. i.e.
"John''s Steakhouse"

In our VFP app with a SQL backend, we have standardized on using the [] as quotes and then strtran() the single quote to double them.
HTH,
Bill Armbrecht
VFP MCP
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform