Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Multiple outputs from XML Source Expand / Collapse
Posted Friday, January 11, 2013 11:26 AM


Group: General Forum Members
Last Login: Thursday, January 22, 2015 8:00 AM
Points: 21, Visits: 176

I'm trying to load xml data into sql table using xml source, the file has around 6000 fileds. When i click on columns in XML source editor i see mutiple outputs each having set of available columns.Now when i connect source to destionation it asking me to select one output from above available outputs.Do we have any option to select all outputs at a time and load into destination? I have around 80 outputs like that.

First time i come across with this scenario,Can anyone please suggest on this?

Post #1406209
Posted Friday, January 11, 2013 8:23 PM

Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, November 14, 2016 4:53 AM
Points: 370, Visits: 1,252
-- load file into xml variable
DECLARE @x xml
SELECT @x = CAST(c1 as xml)
FROM OPENROWSET(BULK 'D:\temp\sampledata.xml', SINGLE_CLOB) t1(c1)

--turn xml into table with nodes() function:
declare @xml as xml = '
<Customer id="1">
<CustomerName>Mr Smith</CustomerName>
<Child ChildName="Peter" />
<Child ChildName="Ivan" />
<Customer id="2">
<CustomerName>Mr Bloggs</CustomerName>
<Child ChildName="John" />
SELECT AOC.Cust.value('.','varchar(max)')
FROM @xml.nodes('/ArrayOfCustomers/Customer') AS AOC(Cust)


Microsoft Certified Master: SQL Server 2008
XDetails Addin - for SQL Developers - Transaction log myths
Post #1406304
Posted Saturday, January 12, 2013 10:34 PM



Group: General Forum Members
Last Login: 2 days ago @ 2:36 AM
Points: 7,933, Visits: 14,357
If you have a complex XML file and SSIS detects 80 outputs then you'll have to process each of the 80 outputs in some form or manner if you want the data loaded somewhere. How do you suppose SSIS could process 80 outputs into one Destination if each output has a different set of fields or different data types?

Maybe you could look into the Bulk XML Loader built into SQLXML. With it you can provide a specialized xsd and the loader will automatically bring the XML into tables you define in the xsd.

There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #1406450
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse