Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 473
  • Last Modified:

XML negating a quote

I Am trying to insert into a tables using XML, But i get a error because the value of one of the xml elements has a single  quote ( < tablename   notes = " 2000.00 rec'd from......" /> ) how do i negate the single quote.
0
afentonjm
Asked:
afentonjm
1 Solution
 
TimCotteeCommented:
Hi afentonjm,

Double it, SQL will interpret two successive ' ('') as a single quote and store the single quote but will not generate an error.

Tim Cottee
Brainbench MVP for Visual Basic
http://www.brainbench.com
0
 
Thandava VallepalliCommented:
Hello,

Use    XML Entity  reference in place of single quote.   i.e  "&#39;".  

Now your new syntax looks like ......

( < tablename   notes = " 2000.00 rec&#39;d from......" /> )



All the best,
V.Thadnava Krishna.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now