Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Creating an SSIS package to generate an XML output file


Creating an SSIS package to generate an XML output file

Author
Message
kbnyny
kbnyny
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 Visits: 142
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
Brandie Tarvin
Brandie Tarvin
SSCertifiable
SSCertifiable (7.7K reputation)SSCertifiable (7.7K reputation)SSCertifiable (7.7K reputation)SSCertifiable (7.7K reputation)SSCertifiable (7.7K reputation)SSCertifiable (7.7K reputation)SSCertifiable (7.7K reputation)SSCertifiable (7.7K reputation)

Group: General Forum Members
Points: 7745 Visits: 8719
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 AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
kbnyny
kbnyny
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 Visits: 142
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.
Brandie Tarvin
Brandie Tarvin
SSCertifiable
SSCertifiable (7.7K reputation)SSCertifiable (7.7K reputation)SSCertifiable (7.7K reputation)SSCertifiable (7.7K reputation)SSCertifiable (7.7K reputation)SSCertifiable (7.7K reputation)SSCertifiable (7.7K reputation)SSCertifiable (7.7K reputation)

Group: General Forum Members
Points: 7745 Visits: 8719
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 AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Koen Verbeeck
Koen Verbeeck
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16366 Visits: 13199
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 SQLKover.

MCSA SQL Server 2012 - MCSE Business Intelligence
kbnyny
kbnyny
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 Visits: 142
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;
kbnyny
kbnyny
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 Visits: 142
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.
Koen Verbeeck
Koen Verbeeck
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16366 Visits: 13199
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 SQLKover.

MCSA SQL Server 2012 - MCSE Business Intelligence
kbnyny
kbnyny
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 Visits: 142
right now there is no error because I have the data type set as Unicode text stream [DT_NTEXT]
Koen Verbeeck
Koen Verbeeck
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16366 Visits: 13199
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 SQLKover.

MCSA SQL Server 2012 - MCSE Business Intelligence
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search