Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 SSIS xml destination help

Author  Topic 

sent_sara
Constraint Violating Yak Guru

377 Posts

Posted - 2010-12-20 : 00:17:03
Hi,

I have a conditional split,from which the output comes as:

Emp Dept
E001 HR
E002 HR
E009 HR


I need to store this output as xml into an output.xml file..since there is no xml destination,iam stuck to continue..can anyone help me?

unfiresniper
Starting Member

5 Posts

Posted - 2010-12-20 : 04:16:02
I guess this could be possible, but which XML format do you prefer?
It's better to write the sample XML content down.
Go to Top of Page

unfiresniper
Starting Member

5 Posts

Posted - 2010-12-20 : 04:31:56
An example here:
Maybe you can do it like this:

Test Script here:

CREATE TABLE #temp(emp NVARCHAR(10), Dept NVARCHAR(10))
INSERT INTO #temp (emp,dept) VALUES ( N'E001',N'HR' )
INSERT INTO #temp (emp,dept) VALUES ( N'E002',N'HR' )
INSERT INTO #temp (emp,dept) VALUES ( N'E009',N'HR' )
SELECT * FROM #temp FOR XML path --(you can define the xml format here by using different options)

Then store the result to a "Flat File Destination", you can name the flat file with "**.xml"
Go to Top of Page

SSISJoost
Starting Member

9 Posts

Posted - 2011-01-18 : 02:08:28
quote:
Originally posted by sent_sara

Hi,

I have a conditional split,from which the output comes as:

Emp Dept
E001 HR
E002 HR
E009 HR


I need to store this output as xml into an output.xml file..since there is no xml destination,iam stuck to continue..can anyone help me?




This example uses a simple script component:
[url]http://microsoft-ssis.blogspot.com/2010/12/flexible-xml-destination.html[/url]
Go to Top of Page
   

- Advertisement -