Click here to Skip to main content
15,914,452 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Folks,

I landed in a weird situation.
I have a table, with just 2 columns. Below is the schema:
SQL
CREATE TABLE [dbo].[StandardView](
    [ViewName] [varchar](50) NULL,
    [Fields] [xml] NULL
) ON [PRIMARY]


I gotta insert a row in the above table.
I am using the below Insert Statement:
SQL
insert into dbo.StandardView values('Standard',N'<?xml version="1.0" encoding="utf-16" standalone="yes"?><FieldName>Name, EmpName & Address, Designation</FieldName>')

<FieldName> tag is given by me, it does not have any significance.
While I execute the above insert statement I get the below error:
Msg 9421, Level 16, State 1, Line 1
XML parsing: line 1, character 236, illegal name character


I even tried Convert before the XML column while inserting, but to no vain.
Experts, please assist here as to where am I going wrong.
Help or pointer will be highly appreciated.

-Regards
Anurag
Posted
Updated 3-Jul-13 3:01am
v2

1 solution

 
Share this answer
 
Comments
Anurag Sinha V 3-Jul-13 9:01am    
Awesome link Rais..thanks for that..I had an ampersand (&) in my entry..changed it to & and it worked..Meanwhile do you knw what can we write in order to pass a dot(.) in xml??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900