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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Handle apostrophe

Status
Not open for further replies.

Palmyra

Programmer
Jan 5, 2007
150
US
Is there a SQL function (instring maybe) to search and replace single quotes (or apostrophes) with double quotes in a string? So that we can insert strings with names like O'Brien, etc.

Thanks.
 
Not built-in
But you could write your own.
BTW If you pass your strings as parameters from your FrontEnd the ODBC driver or Provider will handle then easily.

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
 
I simply remove them...

--Remove Single quotes from the comment
Update [RepliconTemp].[dbo].[tdctim_TDC]
set tmcomment = replace(tmcomment,char(39),'')
where CHARINDEX(char(39), TMCOMMENT)>0

Simi
 
And O'Brien stands OBrien?
Hmmm, not very polite :)

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
 
if I understand your question clearly you might need this


INSERT Table1 (mycolumn)
VALUES ('O''Brien')

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top