Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 1234»»»

Creating an SSIS package to generate an XML output file Expand / Collapse
Author
Message
Posted Wednesday, April 16, 2014 11:23 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, July 2, 2014 8:14 AM
Points: 49, Visits: 122
I have created a SSIS package to generate an XML output file. The package run without any errors. The problem I am having is when I go to open the XML file it has all these crazy looking characters instead of the data that it should have.

In my Data Flow I am using a OLE DB Source with sql command. The script run fine, returning the data that I'm looking for when I run it in a query.

I have a Data Conversion for the input column and output alias with data type unicode text stream [DT_NText]. When I try and change the data type to anything else I get the red x on the flat file destination.

I am using a flat file destinations, mapping is correct.

I am not sure what is wrong. Can someone please help me out.

Thank you,
Kevin
Post #1562400
Posted Wednesday, April 16, 2014 12:17 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 10:37 AM
Points: 5,575, Visits: 6,359
Your XML document may be malformed. Are you sure you have your hierarchy designed correctly?

And are you looking for a full XML document or just a fragment?

EDIT: Are you changing data types on the Connection Manager or in the Data Flow Task?


Brandie Tarvin, MCITP Database Administrator

Webpage: http://www.BrandieTarvin.net
LiveJournal Blog: http://brandietarvin.livejournal.com/
On LinkedIn!, Google+, and Twitter.

Freelance Writer: Shadowrun
Latchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Post #1562409
Posted Wednesday, April 16, 2014 12:27 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, July 2, 2014 8:14 AM
Points: 49, Visits: 122
The Hierarchy design is correct as far as I can see.
The Data type is the same in the connection manager and in the Data Conversion Transformation Editior.

I'm looking for a full XML document.
Post #1562412
Posted Wednesday, April 16, 2014 12:34 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 10:37 AM
Points: 5,575, Visits: 6,359
kbnyny (4/16/2014)
The Data type is the same in the connection manager and in the Data Conversion Transformation Editior.


That's not what I asked. You said you were having problems changing the data type. I'm asking you where you are trying to change the data type that you're getting this problem.

Usually, the change should be made in the Connection Manager first. Then the object(s) in the Data Flow task have to be refreshed (open, then click on Column Mappings, then close the Transformation) to "take" the metadata changes. That clears up any warnings or errors. This may need to be done for multiple objects, depending on if you're changing the source or the destination data.


Brandie Tarvin, MCITP Database Administrator

Webpage: http://www.BrandieTarvin.net
LiveJournal Blog: http://brandietarvin.livejournal.com/
On LinkedIn!, Google+, and Twitter.

Freelance Writer: Shadowrun
Latchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Post #1562414
Posted Wednesday, April 16, 2014 12:37 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:38 AM
Points: 12,962, Visits: 10,733
kbnyny (4/16/2014)
I have created a SSIS package to generate an XML output file. The package run without any errors. The problem I am having is when I go to open the XML file it has all these crazy looking characters instead of the data that it should have.

In my Data Flow I am using a OLE DB Source with sql command. The script run fine, returning the data that I'm looking for when I run it in a query.

I have a Data Conversion for the input column and output alias with data type unicode text stream [DT_NText]. When I try and change the data type to anything else I get the red x on the flat file destination.

I am using a flat file destinations, mapping is correct.

I am not sure what is wrong. Can someone please help me out.

Thank you,
Kevin


Any chance you can share the query that generates the XML?




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1562416
Posted Wednesday, April 16, 2014 1:31 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, July 2, 2014 8:14 AM
Points: 49, Visits: 122
Here is the query that I am using

SELECT DISTINCT TOP 10
PLastName
,PFirstName
,PBorough
,PState
,PZip5
,PIdentificationType
,PIssuedBy
,SCity
,SState
,InspectionDate
,InspectionTime
FROM vwECB
FOR XML RAW('MOV')
,ROOT('ECBXML')
,elements
,BINARY BASE64;
Post #1562427
Posted Wednesday, April 16, 2014 1:34 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, July 2, 2014 8:14 AM
Points: 49, Visits: 122
Sorry Brandie, I did not make myself clear enough. I can change the data type but the problem is when I do change it to anything beside Unicode text stream [DT_NTEXT] I get a red x on the flat file destination.
Post #1562429
Posted Wednesday, April 16, 2014 1:40 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:38 AM
Points: 12,962, Visits: 10,733
kbnyny (4/16/2014)
Sorry Brandie, I did not make myself clear enough. I can change the data type but the problem is when I do change it to anything beside Unicode text stream [DT_NTEXT] I get a red x on the flat file destination.


If you hover over the destination, what is the error message that you get?




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1562430
Posted Wednesday, April 16, 2014 2:07 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, July 2, 2014 8:14 AM
Points: 49, Visits: 122
right now there is no error because I have the data type set as Unicode text stream [DT_NTEXT]
Post #1562447
Posted Wednesday, April 16, 2014 2:12 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:38 AM
Points: 12,962, Visits: 10,733
kbnyny (4/16/2014)
right now there is no error because I have the data type set as Unicode text stream [DT_NTEXT]


What is the encoding of the flat file? ANSI, UTF-8 or unicode? Check in the connection manager.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1562449
« Prev Topic | Next Topic »

Add to briefcase 1234»»»

Permissions Expand / Collapse