By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,131 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

Automagically create database schema from XML dataset

P: n/a
Hello.

I am trying to create a database from an XML file. I am able to create a dataset from the XML doc, but how can I create a database schema from the dataset and populate the database? Or is this even possible using VS.NET 2003?

Part of the XML file follows. Thanks for any help.

Steven
VS.NET 2003 and C# newbie!

----- Part of the XML (one full record across several tables) --------

<!DOCTYPE PubmedArticleSet...>
- <PubmedArticleSet>
- <PubmedArticle>
- <MedlineCitation Owner="NLM" Status="Completed"><PMID>11604973</PMID>
- <DateCreated><Year>2001</Year><Month>10</Month><Day>17</Day></DateCreated>
- <DateCompleted><Year>2002</Year><Month>02</Month><Day>14</Day></DateCompleted>
- <Article>
- <Journal><ISSN>1569-6332</ISSN>
- <JournalIssue PrintYN="Y"><Volume>10</Volume><Issue>Pt 2</Issue>
- <PubDate><Year>2001</Year></PubDate></JournalIssue></Journal><ArticleTitle>Personal health information-seeking: a qualitative review of the literature.</ArticleTitle>
- <Pagination><MedlinePgn>1484-8</MedlinePgn></Pagination>
- <Abstract><AbstractText>This ...</AbstractText></Abstract><Affiliation>Division of Biomedical Informatics and Outcomes Research, Oregon Health Sciences University, Portland, OR, USA. zs*****@theriver.com</Affiliation>
- <AuthorList CompleteYN="Y">
- <Author><LastName>Stavri</LastName><ForeName>P Z</ForeName><Initials>PZ</Initials></Author></AuthorList><Language>eng</Language>
- <PublicationTypeList><PublicationType>Journal Article</PublicationType><PublicationType>Review</PublicationType><PublicationType>Review Literature</PublicationType></PublicationTypeList></Article>
- <MedlineJournalInfo><Country>Netherlands</Country><MedlineTA>Medinfo</MedlineTA><NlmUniqueID>7600347</NlmUniqueID></MedlineJournalInfo><CitationSubset>IM</CitationSubset>
- <MeshHeadingList>
- <MeshHeading><DescriptorName MajorTopicYN="N">Health Education</DescriptorName><QualifierName MajorTopicYN="Y">utilization</QualifierName></MeshHeading>
- <MeshHeading><DescriptorName MajorTopicYN="N">Health Services Accessibility</DescriptorName></MeshHeading>
- <MeshHeading><DescriptorName MajorTopicYN="N">Health Services Needs and Demand</DescriptorName></MeshHeading>
- <MeshHeading><DescriptorName MajorTopicYN="N">Human</DescriptorName></MeshHeading>
- <MeshHeading><DescriptorName MajorTopicYN="N">Information Services</DescriptorName><QualifierName MajorTopicYN="Y">utilization</QualifierName></MeshHeading>
- <MeshHeading><DescriptorName MajorTopicYN="Y">Patient Acceptance of Health Care</DescriptorName></MeshHeading>
- <MeshHeading><DescriptorName MajorTopicYN="N">Patient Participation</DescriptorName></MeshHeading></MeshHeadingList><NumberOfReferences>63</NumberOfReferences></MedlineCitation>
- <PubmedData>
- <History>
- <PubMedPubDate PubStatus="pubmed"><Year>2001</Year><Month>10</Month><Day>18</Day><Hour>10</Hour><Minute>0</Minute></PubMedPubDate>
- <PubMedPubDate PubStatus="medline"><Year>2002</Year><Month>2</Month><Day>15</Day><Hour>10</Hour><Minute>1</Minute></PubMedPubDate></History><PublicationStatus>ppublish</PublicationStatus>
- <ArticleIdList><ArticleId IdType="pubmed">11604973</ArticleId><ArticleId IdType="medline">21490760</ArticleId></ArticleIdList></PubmedData></PubmedArticle>
- <PubmedArticle>
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You might find the Xml Bulk Upload tool easier to work with.

Create a Schema for your Xml File - heck VS will even create a Schema for
you.
You give XML Bulk upload it your Schema can tell it to create the tables for
you and so on.

Note : not always as simple as it sounds - do you have any Schema knowledge?
If not then learn it - it will be invaluable to you.

Here's a nice little article on it http://sightkeys.com?175

Steven
Founder, http://venturetogether.com

"Steven (dotnet newbie)" <an*******@discussions.microsoft.com> wrote in
message news:BD**********************************@microsof t.com...
Hello.

I am trying to create a database from an XML file. I am able to create a dataset from the XML doc, but how can I create a database schema from the
dataset and populate the database? Or is this even possible using VS.NET
2003?
Part of the XML file follows. Thanks for any help.

Steven
VS.NET 2003 and C# newbie!

----- Part of the XML (one full record across several tables) --------

<!DOCTYPE PubmedArticleSet...>
- <PubmedArticleSet>
- <PubmedArticle>
- <MedlineCitation Owner="NLM" Status="Completed"><PMID>11604973</PMID>
- <DateCreated><Year>2001</Year><Month>10</Month><Day>17</Day></DateCreated> - <DateCompleted><Year>2002</Year><Month>02</Month><Day>14</Day></DateComplete
d> - <Article>
- <Journal><ISSN>1569-6332</ISSN>
- <JournalIssue PrintYN="Y"><Volume>10</Volume><Issue>Pt 2</Issue>
- <PubDate><Year>2001</Year></PubDate></JournalIssue></Journal><ArticleTitle>P
ersonal health information-seeking: a qualitative review of the
literature.</ArticleTitle> - <Pagination><MedlinePgn>1484-8</MedlinePgn></Pagination>
- <Abstract><AbstractText>This ....</AbstractText></Abstract><Affiliation>Division of Biomedical Informatics
and Outcomes Research, Oregon Health Sciences University, Portland, OR, USA.
zs*****@theriver.com</Affiliation> - <AuthorList CompleteYN="Y">
- <Author><LastName>Stavri</LastName><ForeName>P Z</ForeName><Initials>PZ</Initials></Author></AuthorList><Language>eng</Lang
uage> - <PublicationTypeList><PublicationType>Journal Article</PublicationType><PublicationType>Review</PublicationType><Publicati
onType>Review Literature</PublicationType></PublicationTypeList></Article> - <MedlineJournalInfo><Country>Netherlands</Country><MedlineTA>Medinfo</Medlin
eTA><NlmUniqueID>7600347</NlmUniqueID></MedlineJournalInfo><CitationSubset>I
M</CitationSubset> - <MeshHeadingList>
- <MeshHeading><DescriptorName MajorTopicYN="N">Health Education</DescriptorName><QualifierName
MajorTopicYN="Y">utilization</QualifierName></MeshHeading> - <MeshHeading><DescriptorName MajorTopicYN="N">Health Services Accessibility</DescriptorName></MeshHeading> - <MeshHeading><DescriptorName MajorTopicYN="N">Health Services Needs and Demand</DescriptorName></MeshHeading> - <MeshHeading><DescriptorName MajorTopicYN="N">Human</DescriptorName></MeshHeading> - <MeshHeading><DescriptorName MajorTopicYN="N">Information Services</DescriptorName><QualifierName
MajorTopicYN="Y">utilization</QualifierName></MeshHeading> - <MeshHeading><DescriptorName MajorTopicYN="Y">Patient Acceptance of Health Care</DescriptorName></MeshHeading> - <MeshHeading><DescriptorName MajorTopicYN="N">Patient Participation</DescriptorName></MeshHeading></MeshHeadingList><NumberOfRefer
ences>63</NumberOfReferences></MedlineCitation> - <PubmedData>
- <History>
- <PubMedPubDate PubStatus="pubmed"><Year>2001</Year><Month>10</Month><Day>18</Day><Hour>10</
Hour><Minute>0</Minute></PubMedPubDate> - <PubMedPubDate PubStatus="medline"><Year>2002</Year><Month>2</Month><Day>15</Day><Hour>10</
Hour><Minute>1</Minute></PubMedPubDate></History><PublicationStatus>ppublish
</PublicationStatus> - <ArticleIdList><ArticleId IdType="pubmed">11604973</ArticleId><ArticleId IdType="medline">21490760</ArticleId></ArticleIdList></PubmedData></PubmedAr
ticle> - <PubmedArticle>

Nov 12 '05 #2

P: n/a
Hi Steven - Xml schema can be difficult at first, but stick with it - it is
probably the coolest stuff in the Xml world (along with Xslt of course
IMHO). Once you learn it you will find it useful all over the place!

Brian Likes has some really great info on Bulk Upload and Sqlxml at
http://www.sqlxml.org/. He also links to the book which he co-wrote (and
which has a good chapter on bulk upload in it).

As for Schema. here are links to some books on Xml Schema
http://sightkeys.com?xmlschema

Any questions let me know.

Steven
Founder, http://venturetogether.com

"Steven (dotnet newbie)" <an*******@discussions.microsoft.com> wrote in
message news:1B**********************************@microsof t.com...
Thanks Steven!

I will start reading the XML Bulk link. I do not have any experience with schemas. It is on my todo list :)
Any great links on Schema knowledge?

Thanks again for your help!!

Steven Waldren

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.