#dBforums RSS Feed iNET Interactive - Online Advertising Agency IFRAME: http://rotator.juggler.inetinteractive.com/servlet/ajrotator/3425/0/vh?z=inet&dim=5925 [vc?z=inet&dim=5925&abr=$imginiframe] [Internet Services --] [divider.gif] [Web Development --] [divider.gif] [Tech Hardware --] [header_left.gif] [logo.gif] [header_right.gif] [topnavbar_left.gif] [topmenu_left.gif] Home | Register | Members | Calendar | Get New | Search | Quick Links [topmenu_right.gif] [yellowline_left.gif] [yellowline_right.gif] [spacer.gif] [spacer.gif] [spacer.gif] [spacer.gif] [vc?z=inet&dim=13,23&abr=$imginiframe] [spacer.gif] [spacer.gif] [spacer.gif] [spacer.gif] Welcome to the dBforums forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact support. If you would prefer not to see any double-underlined words and corresponding advertisements, please click here. Go Back dBforums > Usenet Groups > microsoft.public.sqlserver.* > microsoft.public.sqlserver.xml > XML bulkload help Go to Page... ____ [BUTTON] Reply Thread Tools Search this Thread Display Modes #1 Old 03-19-02, 01:30 Rona Yang Posts: n/a XML bulkload help ________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ Hi experts, I am trying to bulk load an xml doc that looks like this: ... ... ... into a single table that has two columns: word_text and match_id. It's a one-to-many relationship of a word to many matches. How can I implement this using SQLXML mapping schemas (XSD)? Thanks. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! Reply With Quote Rona Yang #2 Old 03-19-02, 10:56 Clint Posts: n/a XML bulkload help ________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ Hello, Are you trying to get an idea on how to write your schema for this database layout? Here is a rough draft that will get you started: Ive some assumptions about your database schema, but this should be a good starting point. Best of luck: C. Field MCDBA >TEST--Original MessageTEST-- Hi experts, > >I am trying to bulk load an xml doc that looks like this: > > > ... ... > ... > >into a single table that has two columns: word_text and match_id. It's >a one-to-many relationship of a word to many matches. How can I >implement this using SQLXML mapping schemas (XSD)? > >Thanks. > >*** Sent via Developersdex http://www.developersdex.com *** >Don't just participate in USENET...get rewarded for it! . Reply With Quote Clint #3 Old 03-19-02, 13:58 Mike Weeder Posts: n/a XML bulkload help ________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ Clint, Looks to me that you gave an xdr mapping instead of an xsd. Does XML Bulk Load support xsd? /\/\ike >TEST--Original MessageTEST-- Hello, Are you trying to get an idea on how to write >your schema for this database layout? > >Here is a rough draft that will get you started: > > xmlns:dt="urn:schemas-microsoft-com:datatypes" >xmlns:sql="urn:schemas-microsoft-com:xml-sql" > > > > > > > > > foreign-key="matchID" foreign-relation="matches" /> > > >Ive some assumptions about your database schema, but this should be a good >starting point. > >Best of luck: >C. Field MCDBA > > >>TEST--Original MessageTEST-- Hi experts, >> >>I am trying to bulk load an xml doc that looks like this: >> >> >> ... ... >> ... >> >>into a single table that has two columns: word_text and >match_id. It's >>a one-to-many relationship of a word to many matches. >How can I >>implement this using SQLXML mapping schemas (XSD)? >> >>Thanks. >> >>*** Sent via Developersdex http://www.developersdex.com >*** >>Don't just participate in USENET...get rewarded for it! . >> >. Reply With Quote Mike Weeder #4 Old 03-19-02, 13:58 Clint Posts: n/a XML bulkload help ________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ Yep. I recently used a similar xdr to do a similar import. It works very well. I think this link may give some good info. http://msdn.microsoft.com/library/default.asp? url=/library/en-us/xmlsql/ac_mschema_78q1.asp Also, check out Graeme Malcolm's book (http://www.microsoft.com/mspress/boo...178.asp#TableO fContents). Good examples of doing this. Cheers! >TEST--Original MessageTEST-- Clint, > >Looks to me that you gave an xdr mapping instead of an xsd. Does XML Bulk Load >support xsd? > >/\/\ike > >>TEST--Original MessageTEST-- Hello, Are you trying to get an idea on how to >>write your schema >>for this database layout? >> >>Here is a rough draft that will get you started: >> >> >xmlns:dt="urn:schemas-microsoft-com:datatypes" >>xmlns:sql="urn:schemas-microsoft-com:xml-sql" > >> >> >> >> >> >> >> >> > foreign-key="matchID" foreign-relation="matches" /> >> >> >>Ive some assumptions about your database schema, but this >>should be a good starting point. >> >>Best of luck: >>C. Field MCDBA >> >> >>>TEST--Original MessageTEST-- Hi experts, >>> >>>I am trying to bulk load an xml doc that looks like this: >>> >>> >>> ... ... >>> ... >>> >>>into a single table that has two columns: word_text and >>match_id. It's >>>a one-to-many relationship of a word to many matches. >>How can I >>>implement this using SQLXML mapping schemas (XSD)? >>> >>>Thanks. >>> >>>*** Sent via Developersdex http://www.developersdex.com >>*** >>>Don't just participate in USENET...get rewarded for it! . >>> >>. >> >. Reply With Quote Clint #5 Old 03-19-02, 13:58 Mike Weeder Posts: n/a XML bulkload help ________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ Clint, Thanks for the info. But again, I need to know does sqlxml suport ~XSD~ mappings. XSD is the w3c standard, not the microsoft standard. I am using XML Spy to help me write these mappings and the export from my SQLdatabase comes in as an XSD schema. When I convert it to XDR, I lose the sql namesspace support. I really like XML spy for what it is doing (and already paid my $500). If not, do you know of any tool that does an export of an existing database to an XDR schema definition. Here is the bottom line. I am using BizTalk to import xml documents. I plan to use the Mapper to map from my input xml document to the sqlxml schema map. Then do the XML Bulk upload from there. Is there a better way to do this? Thanks again for your time. /\/\ike >TEST--Original MessageTEST-- Yep. I recently used a similar xdr to do a similar >import. It works very well. > >I think this link may give some good info. >http://msdn.microsoft.com/library/default.asp? >url=/library/en-us/xmlsql/ac_mschema_78q1.asp > >Also, check out Graeme Malcolm's book > (http://www.microsoft.com/mspress/boo...178.asp#TableO >fContents). Good examples of doing this. > >Cheers! > >>TEST--Original MessageTEST-- Clint, >> >>Looks to me that you gave an xdr mapping instead of an xsd. Does XML Bulk Load >>support xsd? >> >>/\/\ike >> >>>TEST--Original MessageTEST-- Hello, Are you trying to get an idea on how to >>>write your >schema >>>for this database layout? >>> >>>Here is a rough draft that will get you started: >>> >>> >>xmlns:dt="urn:schemas-microsoft-com:datatypes" >>>xmlns:sql="urn:schemas-microsoft-com:xml-sql" > >>> >>> >>> >>> >>> >>> >>> >>> >> foreign-key="matchID" foreign-relation="matches" /> >>> >>> >>>Ive some assumptions about your database schema, but >this >>>should be a good starting point. >>> >>>Best of luck: >>>C. Field MCDBA >>> >>> >>>>TEST--Original MessageTEST-- Hi experts, >>>> >>>>I am trying to bulk load an xml doc that looks like >this: >>>> >>>> >>>> ... >>>>... ... >>>> >>>>into a single table that has two columns: word_text and >>>match_id. It's >>>>a one-to-many relationship of a word to many matches. >>>How can I >>>>implement this using SQLXML mapping schemas (XSD)? >>>> >>>>Thanks. >>>> >>>>*** Sent via Developersdex http://www.developersdex.com >>>*** >>>>Don't just participate in USENET...get rewarded for it! . >>>> >>>. >>> >>. >> >. Reply With Quote Mike Weeder #6 Old 03-19-02, 17:15 Clint Posts: n/a XML bulkload help ________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ Ahh, sorry. I read it too quickly. XML Spy is a great tool, but I usually only use it for XSL. While I have heard it has the capability to export a database to an XDR, I currently use the SQL Server XML View Mapper. It will take the database, and allow you to choose the tables you want to map to an XDR schema. Very easy to use, and rumor has it that the next version will much friendlier. If you are importing relatively small xml documents(under 5 mb), I would use the combination of an activex script and a stored procedure using the OpenXML function. I believe that you can have BizTalk route a document to a port which can deliver the document in a variety of ways (HTTP, file location, etc.) This would allow you to write a script in ASP if you used the URL over HTTP method. For large documents, I would create a job in SQL server. Write an activex script giving the location of the xml document (have BizTalk place the file), then the location of the XDR schema. You will have to use the SQLXMLBulkLoad object in this script. But the script is easy to write. Microsoft Products use the XDR (not XSD) for schema definitions, and probably will for sometime (Correct me if you hear differently.) Let me know if you have any questions on how to write your XDR. Ill need a sample of your XML and your database layout. Also, how many records are you typically going to insert? Y. Field MCDBA >TEST--Original MessageTEST-- Clint, > >Thanks for the info. But again, I need to know does sqlxml suport ~XSD~ mappings. >XSD is the w3c standard, not the microsoft standard. I am using XML Spy to help me >write these mappings and the export from my SQLdatabase comes in as an XSD schema. >When I convert it to XDR, I lose the sql namesspace support. I really like XML spy >for what it is doing (and already paid my $500). > >If not, do you know of any tool that does an export of an existing database to an >XDR schema definition. > >Here is the bottom line. I am using BizTalk to import xml >documents. I plan to use the Mapper to map from my input xml document to the >sqlxml schema map. Then do the XML Bulk upload from there. Is there a better way >to do this? > >Thanks again for your time. Reply With Quote Clint #7 Old 03-19-02, 19:49 Dan Doris -Lsqms Posts: n/a Re: XML bulkload help ________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ Both WR2 and WR3 support XSD. For converting the xdr -> xsd i would suggest using cvtschema.exe provided with both WR2 and WR3. Sound like there is a limitation with the tools you are currently using to do the conversion. Dan Doris This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use. "Mike Weeder" wrote in message news:4f4301c1cf6f$7af2b350$36ef2ecf@tkmsftngxa12... > Clint, > > Thanks for the info. But again, I need to know does sqlxml suport ~XSD~ mappings. > XSD is the w3c standard, not the microsoft standard. I am using XML Spy to help me > write these mappings and the export from my SQLdatabase comes in as an XSD schema. > When I convert it to XDR, I lose the sql namesspace support. I really like XML spy > for what it is doing (and already paid my $500). > > If not, do you know of any tool that does an export of an existing database to an > XDR schema definition. > > Here is the bottom line. I am using BizTalk to import xml documents. I plan to use > the Mapper to map from my input xml document to the sqlxml schema map. Then do the > XML Bulk upload from there. Is there a better way to do this? > > Thanks again for your time. > > /\/\ike > >TEST--Original MessageTEST-- Yep. I recently used a similar xdr to do a similar > >import. It works very well. > > > >I think this link may give some good info. > >http://msdn.microsoft.com/library/default.asp? > >url=/library/en-us/xmlsql/ac_mschema_78q1.asp > > > >Also, check out Graeme Malcolm's book > > > (http://www.microsoft.com/mspress/boo...178.asp#TableO > >fContents). Good examples of doing this. > > > >Cheers! > > > >>TEST--Original MessageTEST-- Clint, > >> > >>Looks to me that you gave an xdr mapping instead of an xsd. Does XML Bulk Load > >>support xsd? > >> > >>/\/\ike > >> > >>>TEST--Original MessageTEST-- Hello, Are you trying to get an idea on how to > >>>write your > >schema > >>>for this database layout? > >>> > >>>Here is a rough draft that will get you started: > >>> > >>> >>>xmlns:dt="urn:schemas-microsoft-com:datatypes" > >>>xmlns:sql="urn:schemas-microsoft-com:xml-sql" > > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> >>> foreign-key="matchID" foreign-relation="matches" /> > >>> > >>> > >>>Ive some assumptions about your database schema, but > >this > >>>should be a good starting point. > >>> > >>>Best of luck: > >>>C. Field MCDBA > >>> > >>> > >>>>TEST--Original MessageTEST-- Hi experts, > >>>> > >>>>I am trying to bulk load an xml doc that looks like > >this: > >>>> > >>>> > >>>> ... > >>>>... ... > >>>> > >>>>into a single table that has two columns: word_text > and > >>>match_id. It's > >>>>a one-to-many relationship of a word to many matches. > >>>How can I > >>>>implement this using SQLXML mapping schemas (XSD)? > >>>> > >>>>Thanks. > >>>> > >>>>*** Sent via Developersdex > http://www.developersdex.com > >>>*** > >>>>Don't just participate in USENET...get rewarded for it! . > >>>> > >>>. > >>> > >>. > >> > >. Reply With Quote Dan Doris -Lsqms #8 Old 03-20-02, 11:04 Clint Posts: n/a Re: XML bulkload help ________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ cvtschema.exe? Sounds interesting. Any links that show usage of this? Thanks! >TEST--Original MessageTEST-- Both WR2 and WR3 support XSD. For converting the xdr -> xsd i would suggest >using cvtschema.exe provided with both WR2 and WR3. Sound like there is a >limitation with the tools you are currently using to do the conversion. > > > Dan Doris Reply With Quote Clint #9 Old 03-21-02, 04:53 Dan Doris -Lsqms Posts: n/a Re: XML bulkload help ________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ There are instructions in the help file for either WR2 and WR3. dan "Clint" wrote in message news:54ee01c1d00e$bd864f20$36ef2ecf@tkmsftngxa12... > cvtschema.exe? > > Sounds interesting. Any links that show usage of this? > > Thanks! > > >TEST--Original MessageTEST-- Both WR2 and WR3 support XSD. For converting > >the xdr -> > xsd i would suggest > >using cvtschema.exe provided with both WR2 and WR3. > Sound like there is a > >limitation with the tools you are currently using to do > the conversion. > > > > > > Dan Doris Reply With Quote Dan Doris -Lsqms #10 Old 03-26-02, 09:30 Drew Minkin Posts: n/a RE: XML bulkload help ________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ Rona, What you are really asking is whether or not the sql:relationship element supports one to many relationships when there is no constraint on the table to enforce that either defines a primary or foreign key. If you trace a Bulk Load using sql:relationship, you will see it runs sp_foreign_keys_rowset to determine if there are such constraints. Simply put, you can do self joins using views and the sql_relationship without formal keys, but bulk load requires them. Investigate using XSLT to change the structure and iteratively add attributes with the parent key information or consider using OPENXML as follows: DECLARE @idoc int DECLARE @doc varchar(1000) SET @doc =' ' --Create an internal representation of the XML document. EXEC sp_xml_preparedocument @idoc OUTPUT, @doc -- Execute a SELECT statement that uses the OPENXML rowset provider. INSERT INTO #temptable SELECT * FROM OPENXML (@idoc, '/topelement/word/match',8) WITH ( text varchar(10) 'parent::word/@text' , ID int '@matchID' ) EXEC sp_xml_removedocument @idoc Thank you for your post and I hope you found the information helpful. Drew Minkin, MCDBA, MCSD, MCSE SQL Support Professional, Microsoft Corporation email: dminkin@online.microsoft.com This posting is provide "AS IS" with no warranties, and confers no rights. Please do not send email directly to this alias. Respond to the newsgroup For the latest in SQLXML, check out http://www.microsoft.com/sql/techinfo/xml Are you secure? For information about the Microsoft Strategic Technology Protection Program and to order your FREE Security Tool Kit, please visit http://www.microsoft.com/security. Reply With Quote Drew Minkin Reply « Previous Thread | Next Thread » Thread Tools Search this Thread Show Printable Version Show Printable Version Email this Page Email this Page Search this Thread: ____________________ Go Advanced Search Display Modes Linear Mode Linear Mode Hybrid Mode Switch to Hybrid Mode Threaded Mode Switch to Threaded Mode Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts ________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ vB code is On Smilies are Off [IMG] code is Off HTML code is Off Forum Jump [ microsoft.public.sqlserver.xml..................] Go [bannerrow_left.gif] [bottombanner_top.gif] [bottombanner_left.gif] IFRAME: http://rotator.juggler.inetinteractive.com/servlet/ajrotator/58/0/viewHTML?zone=inet&channel=721&dim=13 [viewCGI?zone=inet&channel=721&dim=13&abr=$imginiframe] [bottombanner_right.gif] [bottombanner_bottom.gif] [bannerrow_right.gif] [bottomnavbar_left.gif] Home | Register | Archive | Get New | FAQ's [bottomnavbar_right.gif] [rackspace.gif] Copyright ©2001-2005 dBforums.com. All Rights Reserved. A division of iNET Interactive. Advertise on dBForums Other iNET Interactive Sites: Webhostingtalk.com | SwishTalk.com | HostingCatalog.com | DevPapers.com | ProgrammingTalk.com | HotScripts.com Powered by vBulletin Version 3.5.3 Copyright ©2000 - 2006, Jelsoft Enterprises Ltd. [adjuggler.gif]