Re: Two questions about moving data between a SQL DB and XML



Jen,

If you are using the dataset.writeXML method, than just add the schema as a
second parameter, the null columns are not written, but they are used when
you want to import again.

Be aware that this is not such an efficient methode than as Bill told.

I use myself the dataset for another purpose, that did mean that I had to
use normal XML methods (XMLDocument) to make it with empty values.

Cor

"Jen" <none@xxxxxxxxxxx> schreef in bericht
news:ecAy7UsBHHA.4908@xxxxxxxxxxxxxxxxxxxxxxx
This is for a custom database export/import utility I'm writing. So I
need some kind of file format. Is there a better option than XML?

Basically the utility is exporting user-selected records from about a
dozen tables from one database and importing them into another database
some time later. The utility remaps primary key ids and writes the
records into the database. I have the key remapping done, that was easy.
Just trying to figure out how to write the DataSet into the database. I
guess I'll just do it the hard way: loop through records in each table
and INSERT them. I was just hoping there would be a quicker/easier way.

"William (Bill) Vaughn" <billvaRemoveThis@xxxxxxxxxx> wrote in message
news:OfU8H$rBHHA.1196@xxxxxxxxxxxxxxxxxxxxxxx
Why are you transporting to XML? Why not use some other more compatible
format?


--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no
rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
Between now and Nov. 6th 2006 you can sign up for a substantial discount.
Look for the "Early Bird" discount checkbox on the registration form...
-----------------------------------------------------------------------------------------------------------------------

"Jen" <none@xxxxxxxxxxx> wrote in message
news:uet4IurBHHA.5068@xxxxxxxxxxxxxxxxxxxxxxx
1) I am exporting data from a SQL DB to an XML file. It works great
but it appears that null data in database records does not get put into
the XML. Is there a way to force it to always put the null data there
instead of omitting it?

2) How do I insert the data back into the SQL DB from the XML file?







.



Relevant Pages

  • Re: Data storage solution advice sought...
    ... First, forget XML. ... You do have the limitation that the database is single user of ... > -Replicating with a SQL Server will not be offered as an option as this is ... > my development), XML files, Pocket Access, SQL Server 2005 Mobile. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: ASP SITE with SQL Server--best way to backup?
    ... Have them restore the backup made 4 days ago. ... <<<how hard would it be to restore from XML to the database if things went ... meaning that you could restore the data easily, but only if the SQL Server ... XML per se. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP SITE with SQL Server--best way to backup?
    ... Have them restore the backup made 4 days ago. ... <<<how hard would it be to restore from XML to the database if things went ... meaning that you could restore the data easily, but only if the SQL Server ... XML per se. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Recommendations - XML or traditional relational structure
    ... As one who has designed database systems and transport mechanisms for the ... public health community I would ... HL7 ver 3 is built on XML and RIM. ... The backend is SQL Server 2005. ...
    (microsoft.public.sqlserver.xml)
  • Re: DISCOVER_XML_METADATA
    ... expansion of ASSL XML returned by the server. ... You could do ExpandObject for the server in step 1. ... you could request ExpandObject for that database -- this is step ... all cubes and nothing else. ...
    (microsoft.public.sqlserver.olap)