General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>>I am trying to insert records into a SQL Server 7.0 table where some of the text fields contain double and/or single quotes. I have searched the UT on this issue and found that the solution is to add an extra quote when one is found in the string, but this isn't working for me. When I add an extra quote, I get both quotes in my field.
>>
>>I have read the SET QUOTED_IDENTIFIER section in the BOL, but it is not completely clear. Does that setting only apply at the time the structure is created?
>
>SQL Server only accepts single quotes around strings (you may already know that, but JIC)
>
>Could you post the SQL code you're using?
>
>It should look something like this:
>
>SQLEXEC(lnValidHandle, "INSERT INTO mytable (cname) VALUES ('Bob''s Big Boy')")
>
>Even if it looks exactly like this, go ahead and post it.
>HTH
I finally got this to work. I'm building my INSERT/UPDATE statements dynamically and I was always adding a single/double quote for each one I found. Problem was, I didn't need to do that for double quotes inside a value delimited by single quotes.
Thanks for the help..
Steve
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only