Jump to content
Crazyfrog2005

How to creat a mapping schema in this case?

Recommended Posts

Hi everyoneI am having a problem with creating a mapping shema to bulk load a xml data file to sql server 2000 enterprise manager. I am new to xml schema. I have read some online examples, however, can't solve it. My case is a bit more complicated. After 2 hours debugging, not yet finished. My xml file is like that below:<details> <manager> <id>0</id> <sign_id>104</sign_id> <staff_no>532257</staff_no> <sign_name>Carolyn Ng</sign_name> <sign_title>Director Relationships</sign_title> <sign_phone>empty</sign_phone> <sign_fax>empty</sign_fax> <email_addr>carolyn_ng@westpac.co.nz</email_addr> <signature> <image file="I:\Analytics\Campaigns\Signatures\104.tif"> </image> </signature> </manager> ...</details>And there is a table 'tblSignature' in sql server database, which is to be filled in with the data in xml file.I feel the hardest part is the elements <signature> and <image>, and the attribute "file". What i am thinking now is I may have to create 3 tables in order to load this xml file to database. One for element <manager>, one for element <signature>, and one for <image>. And there is a relationship among those 3. But since every table should have a primary key, whereas <signature> obiviously has only a link to <image>, it makes me screwed up here. In addition, all i want is to load all the data in xml file into 1 table rather than 3. Can anyone help me with this please? Many thanks.

Share this post


Link to post
Share on other sites

Hi,For each signature, does it only have one image file? Or a signature can have many images? If it only has one image, I think you can create just one table manager. Then id, sign_id, ... signature are the columns. In signature, just put in the image file name.(Btw I'm also new to XSchema)

Share this post


Link to post
Share on other sites
Hi,For each signature, does it only have one image file? Or a signature can have many images? If it only has one image, I think you can create just one table manager. Then id, sign_id, ... signature are the columns. In signature, just put in the image file name.(Btw I'm also new to XSchema)

:) Hi budThere is only one image file for each signature. Yes, actually I am going to design one table to put all of the data in, which is exactly the same as your design idea. However, my problem here is how to create a mapping schema to do so. I tried many times and encountered some error messages. I solved some, but still debugging and don't know how far i need to go to have it done. What i am doing now is i download a software called 'ms xml viewer', which looks pretty good. However, i am not familiar with it and play with it at the moment. But it seems only help you to create a schema based on either a database table, or a xml data file. In order to create a well-matched mapping schema to both of my database table and xml file, i still have no idea to do. :) I am really a newbie, amn't I? Hopefully, you or someone xml pro can give me advice. Many thanks. Btw, glad to see your reply. Cheers

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...