Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 xml

Author  Topic 

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2008-10-14 : 06:35:18
I have copied the contents of an xml file into an xml field of a sql server table using openrowset
i.e.
INSERT INTO tblImportXML (FileType, dataXML)
SELECT 'debt', x.y
FROM OPENROWSET(BULK 'C:\Work\data.xml', SINGLE_CLOB ) x(y)

Then I can see the xml when I run select * from tblImportXML
BUT, I am not sure why when I click on the xml link in the row of the tblImportXML, the message I get is:
Unable to show xml. Unexpected end of file has occured and it gives the line number.
So I traced the line number and see this in xml

<Section>Yes</K_DocumentationSection>
<Details><![CDATA['test:12345
'04 test2:805561
'04 test3:805718
'04 test4:784585
'04 test5 (English law) :123
'04 test6 (Netherlands law) :543
'04 test7 ?????]]>
</Details>
<InfoDate>01/01/2001
</InfoDate>

It seems the error is inside [CDATA
could it be to do with the bracket i.e. (
?
Thanks
   

- Advertisement -