June 9, 2009 at 4:59 pm
I have a DTS package which imports xml data into a table; I have vb script in ActiveX script to accomplish this
see sample code
Dim objBL
Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
objBL.ConnectionString = "provider=SQLOLEDB.1;data source=server1\instance1;database=databse1;uid=uid;pwd=pwd"
objBL.KeepIdentity = False
objBL.ErrorLogFile = "C:\folder1\Error.LOG"
objBL.Execute "C:\folder1\xmlmap\file.XML", "C:\folder2\xmldata\file2.XML"
where file.xml is xml file for the table and file2 is the xml data to be inported;
can we implement the say process in SSIS; if we have the mapping and data xml files; if yes how
Thanks
June 10, 2009 at 6:16 am
washawgolla (6/9/2009)
I have a DTS package which imports xml data into a table; I have vb script in ActiveX script to accomplish thissee sample code
Dim objBL
Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
objBL.ConnectionString = "provider=SQLOLEDB.1;data source=server1\instance1;database=databse1;uid=uid;pwd=pwd"
objBL.KeepIdentity = False
objBL.ErrorLogFile = "C:\folder1\Error.LOG"
objBL.Execute "C:\folder1\xmlmap\file.XML", "C:\folder2\xmldata\file2.XML"
where file.xml is xml file for the table and file2 is the xml data to be inported;
can we implement the say process in SSIS; if we have the mapping and data xml files; if yes how
Thanks
It will not be easy to use SQLXMLBulkLoad object in SSIS. You can check this discussion for more information why. What you can is try to use the standard components available in SSIS. You have to:
1. Insert data flow task.
2. Go to data flow task canvas.
3. Insert XML Source component and point it to your source XML document.
4. Insert SQL Server Destination (or OLE DB Destination).
5. Connect the XML Source to the destination.
June 10, 2009 at 8:11 am
thank you cozysoc;
what if I have multiple xml files
June 10, 2009 at 8:19 am
washawgolla (6/10/2009)
thank you cozysoc;what if I have multiple xml files
If the XML format is same then you can setup the XML source to be configurable and use different source file. If the format is different, then you have to create separate data flow for each and every XML format you need.
June 11, 2009 at 11:26 am
THant was a helpful response cosyRoc; I am having this problem to import those xml files to a table using SSIS
[SQL Server Destination [2984]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "server1\instance1.databse1" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
June 11, 2009 at 12:06 pm
washawgolla (6/11/2009)
THant was a helpful response cosyRoc; I am having this problem to import those xml files to a table using SSIS[SQL Server Destination [2984]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "server1\instance1.databse1" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
Review your connection manager. Make sure you "Test" the connection from the setup dialog.
April 26, 2010 at 10:46 am
how can I use "XML file from variable" as I have a list of xml files? I use Foreach Loop container and able to get full path of xml file, but when I set Data Access mode to XML file from variable, I have an errors:
"XML Source (228) was unable to read the XML data." It seems that I have to do this at run time in Design Script.
November 19, 2010 at 5:36 am
Hi,
i am having 15 xml files with the same format in it but with different data in them, i have to move all xml files in to the 15 tables in sql server 2008, using the foreach loop to do the task but stuck up.can you please explain briefly how to import multiple xml files to sql database using ssis, i am using sql server 2008
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply