question

Maylin avatar image
Maylin asked

How do I export data from an XML file to SQL table?

I need to export data from an XML file to update a SQL table. It is only 2 records not the entire table. I'm running this as a vbs. I'm getting a compilation error(Expected statement) This is what I have so far for the mapping: Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad") objBL.ConnectionString = "provider=SQLOLEDB.1;data source=MySQLServer;database=MyDatabase;uid=MyAccount;pwd=MyPassword" objBL.ErrorLogFile = "c:\error.log" objBL.Execute "c:\extractor.xml" Set objBL = Nothing
xmldata-importvbscript
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

bhanupratapsngh9 avatar image bhanupratapsngh9 commented ·
Just Read XML from a file and store it in dataset using function readxmllll now just save this dataset using Table valued Parameter void readxmllll() { string myXMLfile = @"D:\a.xml"; DataSet ds = new DataSet(); // Create new FileStream with which to read the schema. System.IO.FileStream fsReadXml = new System.IO.FileStream (myXMLfile, System.IO.FileMode.Open); try { ds.ReadXml(fsReadXml); } catch(Exception e) {} } TVP Help http://www.mssqltips.com/sqlservertip/2112/table-value-parameters-in-sql-server-2008-and-net-c/
0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.