Re: SQLXMLBulkLoad of text child nodes vs. attributes?
From: Chandra Kalyanaraman [MSFT] (chandrak_at_online.microsoft.com)
Date: 11/02/04
- Next message: Chandra Kalyanaraman [MSFT]: "Re: Mapping issue"
- Previous message: WTH: "Re: Can I just get a string back from SQL Server with "FOR XML AUTO, ELEMENTS"?"
- In reply to: weinerk_at_gmail.com: "Re: SQLXMLBulkLoad of text child nodes vs. attributes?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 2 Nov 2004 14:14:55 -0800
Hi
You could use the XSDInference tool to get a XSD schema from xml.
http://apps.gotdotnet.com/xmltools/xsdinference/ is the link
this creates an XSD, but you need to annotate it with sqlxml specific
annotations to make it a proper sqlxml schema.
SQLXMLBulkLoad SchemaGen will be able to create tables. but it cannot create
constraints unless the sql:relationship , sql:relation and sql:key-fields
annotations are specified correctly.
you can also use a tool called cvtschema.exe that comes with SQLXML to
convert XDR to XSD
thanks
Chandra
-- This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm <weinerk@gmail.com> wrote in message news:1099361085.995269.309570@z14g2000cwz.googlegroups.com... > 1) thanks for reply. > 2) In that case would you recommend to rewrite the XML so that the text > maps as > 3) I was using "MS SQL XML view mapper" to automatically produce the > schema from XML, > so I could map and bulkload the XML into DB. Is there a better way? > 4) does SQLXMLBulkLoad SchemaGen option work if I get the schema > nailed? > 5) also please elaborate about "moving to XSD" or a pointer where to > read up on it (not just about XSD). > > thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!! > > > Irwin Dolobowsky [MSFT] wrote: >> you can only map simple-type elements to columns. ALso, I would > recommend >> moving to XSD. >> >> -- >> Thanks, >> Irwin >> >> Irwin Dolobowsky >> Program Manager, SqlXml >> http://blogs.msdn.com/irwando >> >> This posting is provided "AS IS" with no warranties, and confers no > rights. >> >> >> "KW" <newsgroups@weinerk.mailshell.com> wrote in message >> news:f9f22f30.0411010908.78662fc6@posting.google.com... >> > SQLXMLBulkLoad of text child nodes vs. attributes? >> > >> > Given: >> > 1) XML something like <e1 a1="aaa" a2="bbb">CDATA[[blah]]</e1> >> > 2) using MSSQL 2K with SQLXML 3 >> > 3) using MS XML View Mapper to make the xdr to load data >> > 4) using vbs to oXMLBulkLoad.Execute "C:\XMLData\kw.xdr", >> > "C:\XMLData\tmp.xml" >> > >> > Question: >> > XML element attributes map to SQL schema OK >> > but how do I map the XML element child text to a field in SQL > record? >
- Next message: Chandra Kalyanaraman [MSFT]: "Re: Mapping issue"
- Previous message: WTH: "Re: Can I just get a string back from SQL Server with "FOR XML AUTO, ELEMENTS"?"
- In reply to: weinerk_at_gmail.com: "Re: SQLXMLBulkLoad of text child nodes vs. attributes?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|