By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,419 Members | 1,609 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,419 IT Pros & Developers. It's quick & easy.

Inserting data to xml column

100+
P: 366
HI Friends

i am using sqlserver2005 .
I have column in my table with xml DataType .and while i am inserting data into it ,if '&' is there in data it is giving xml parser error as

"XML parsing: line 1, character 15, illegal name character"

i have idea that xml parsing & is represented as 'amp' , but i cannot do that
my requirement is to insert the data as it is.

ex:of my insert statement is

insert into dbo.XMLTest values ('~ABC; XXX ABC& !ABC');

is there any alternative way to insert "~ABC; XXX ABC& !ABC" in to xml column


Thanks
Dec 19 '08 #1
Share this Question
Share on Google+
1 Reply


ck9663
Expert 2.5K+
P: 2,878
Can you get the value into a nvarchar variable, manipulate it and store it back? Just make sure your string is a valid xml.

-- CK
Dec 19 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.