Problem with SQL and Single quote

kcwallace
10-25-2004, 07:00 PM
I am trying to update a SQL Server 2000 database with the value from a textbox on an ASP page.

Using Access I've always just done (Ken's Function):
"UPDATE table1 SET [txt]='" & "Ken" & Chr(39) & "s Function" & "'"

However, with SQL Server I get the following error.

"'chr' is not a recognized function name."

I realize I need to write some sort of SQL User Defined Function, but am unsure how.

Can Anyone Help?

kcwallace
10-25-2004, 07:21 PM
I figured it out

"UPDATE table1 SET [txt]='Ken'+char(39)+'s Function'"

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum