請教:如何load數據從xml file 進入sql database table

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

請您先登陸,再發跟帖!