请教:如何load数据从xml file 进入sql database table

来源: 黑衬衫 2017-07-04 06:51:27 [] [旧帖] [给我悄悄话] 本文已被阅读: 次 (98 bytes)

XML 里面有大量的nested level, 有什么方法load吗?

谢谢????.

所有跟帖: 

I know you can do in Oracle using PL/SQL. I do not know if you c -玉树临风_- 给 玉树临风_ 发送悄悄话 玉树临风_ 的博客首页 (107 bytes) () 07/04/2017 postreply 07:21:33

要不试一试:) 谢谢. -黑衬衫- 给 黑衬衫 发送悄悄话 (0 bytes) () 07/04/2017 postreply 07:31:08

可用 SSIS (SQL Server Integration Services) import xml file -ViBravo- 给 ViBravo 发送悄悄话 (0 bytes) () 07/04/2017 postreply 07:44:01

谢谢,需要自己先create table吗? -黑衬衫- 给 黑衬衫 发送悄悄话 (139 bytes) () 07/04/2017 postreply 07:51:18

要,还要column mapping,比import text file 麻烦些 -ViBravo- 给 ViBravo 发送悄悄话 (0 bytes) () 07/04/2017 postreply 07:58:03

做之前,是不是先要figure out table之间的关系 -黑衬衫- 给 黑衬衫 发送悄悄话 (78 bytes) () 07/04/2017 postreply 08:11:31

PK 和 FK 的设定跟 tables 和 data 都有关 -ViBravo- 给 ViBravo 发送悄悄话 (0 bytes) () 07/04/2017 postreply 08:27:09

那我的file里有大量的parent table 和child table, -黑衬衫- 给 黑衬衫 发送悄悄话 (289 bytes) () 07/04/2017 postreply 08:37:17

不是这样做。在import xml file前,先用SSIS generate XSD(xml schema definitio -ViBravo- 给 ViBravo 发送悄悄话 (172 bytes) () 07/04/2017 postreply 08:53:30

谢谢????,我不知道如何做,我再研究下. -黑衬衫- 给 黑衬衫 发送悄悄话 (0 bytes) () 07/04/2017 postreply 09:11:34

就是说XSD会自己create table在sql server吗? -黑衬衫- 给 黑衬衫 发送悄悄话 (0 bytes) () 07/04/2017 postreply 09:15:14

XSD只是显示 data structure。destination tables还要另外create -ViBravo- 给 ViBravo 发送悄悄话 (0 bytes) () 07/04/2017 postreply 09:39:00

那就是说:还得自己一个一个的在sql server destination database create table, pk -黑衬衫- 给 黑衬衫 发送悄悄话 (30 bytes) () 07/04/2017 postreply 09:50:34

Yes -ViBravo- 给 ViBravo 发送悄悄话 (0 bytes) () 07/04/2017 postreply 10:19:31

Thank you very much ! -黑衬衫- 给 黑衬衫 发送悄悄话 (0 bytes) () 07/04/2017 postreply 10:29:28

转化到excel里面,再转是不是方便些? -Icat- 给 Icat 发送悄悄话 Icat 的博客首页 (0 bytes) () 07/04/2017 postreply 19:54:28

可以用ETLtool -genghis2011- 给 genghis2011 发送悄悄话 (0 bytes) () 07/04/2017 postreply 20:57:18

请您先登陆,再发跟帖!

发现Adblock插件

如要继续浏览
请支持本站 请务必在本站关闭/移除任何Adblock

关闭Adblock后 请点击

请参考如何关闭Adblock/Adblock plus

安装Adblock plus用户请点击浏览器图标
选择“Disable on www.wenxuecity.com”

安装Adblock用户请点击图标
选择“don't run on pages on this domain”