Monday, February 20, 2012

Loading XML data using DTS.

I am trying to load XML data into SQL Server 2000/sp3a. Since the XML document is in a file, I used DTS to first load the data into a temporary file (with a text field, used varchar(5000) as well) and then copy it into a variable for use in sp_xml_prepare
document.
Everything works fine except that of the date field. For instance, I have defined it as
<ReceivedDate>2004-03-29</ReceivedDate>
However, once it is loaded into the temporary table it is saved as
<ReceivedDate>2004-29-03</ReceivedDate>
I think I am missing something. Please help.
Thanks,
MZeeshan
I'm new at XML, but what I've played with so far, SQL does not create a
root element for your xml file. It looks like it's using the first
record's properties/child elements to name your table?
Robert
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
|||Well... I ve created a table myself for getting the parsed data. I am getting that through SQL server provided T-SQL utility OPENXML. That is working fine. However, there is some problem in transformation.
|||This is unrelated to the DTS question.
You can add a root element using the root node property of ADO/OLEDB/URL
queries, use an explicit mode query to add it or (only available in the
upcoming SQL Server 2005) use the ROOT directive on a FOR XML clause.
Best regards
Michael
"Robert Taylor" <anonymous@.devdex.com> wrote in message
news:ejkj$lpQEHA.1440@.TK2MSFTNGP10.phx.gbl...
> I'm new at XML, but what I've played with so far, SQL does not create a
> root element for your xml file. It looks like it's using the first
> record's properties/child elements to name your table?
> Robert
>
> *** Sent via Developersdex http://www.codecomments.com ***
> Don't just participate in USENET...get rewarded for it!

No comments:

Post a Comment