Hi all,
From https://www.simple-talk.com/content/print.aspx?article=1756, I mimicked to create the following sql code to do Importing XML data using a CTE:
---Importing XML data using a CTE -----Ad-Hoc XML File Query--simple-talk---1020AM 27 Feb 2015 ---query the XML Blob using a CTE (pulling from the XML file each time USE OPENXMLtesting1 GO With XmlFile (Contents) AS ( SELECT CONVERT (XML, BulkColumn) FROM OPENROWSET (BULK 'C:\XML FilesMicrosoft-Samples\books.xml', SINGLE BLOB) AS XmlData SELECT FROM XmlFile GO I got the following message:
Msg 102, Level 15, State 1, Line 4 Incorrect syntax near 'BLOB'. I have no ideas why it is incorrect in that code statment. Please kindly help, advise and respond.
Thanks in advance,
Scott Chang
P. S. The books.xml file was copied ...

Go to the complete details ...