| Hi, I am having trouble bulkloading xml into SQL from a stream. I am able to bulkload the XML from a file, but I want to load it into an XMLDocument first and then bulkload it. I understand that the bulkload execute command is overloaded to do this but no matter what I try I get an 'Error opening the data file.' exception. I am using SQLXML 3.0 and C#. Does anyone have any ideas Thanks. |

Trouble with XML Bulkloading from a stream
manix
Thanks Bertan.
Jerry K
Unfortunately, you have to pass a stream that implements the native IStream interface which is different than the Stream returned from the XmlDocument.
There is an article on this issue:
http://msdn.microsoft.com/xml/default.aspx pull=/library/en-us/dnsql90/html/exchsqlxml.asp
That should help
Bertan
TerrariumNewbie
I am using the XMLDocument Save method to save the XMLDocument as a stream then bulk loading the stream.
Thanks.
Chandrak Bhavsar
I am kind of confused about loading the Xml file into XmlDocument and how you use the Bulkload. Are you passing an XmlDocument to Bulkload If so, this is not possible. You can only pass a file uri or a stream to bulklad as data xml.