将CSV文件中的数据加载到多个表中
我必须将.csv文件中的数据加载到几个具有参照完整性的sql server表中。
什么是加载数据的最佳方法任何参照完整性或其他问题。
它是通过SSMS导入任务轻松还是编写脚本方式?
b
$
表1 ==> PK col +一些列
表2 ==> PK +一些列+ FK到TABLE1
表3 ==> PK +一些列
表4 ==> PK +一些列+ FK到TABLE2
表5 ==> PK +一些列+ FK到TABLE2和TABLE3
表6 ==> MAster表包含所有其他表PK列作为FK +其他一些列
注意:其他一些列我的默认值也像User(SUSER)和DAteCol是GETDATE()
您的输入非常感谢!
谢谢
Hi,
I have to load the data from .csv file into few sql server tables which have referential integrity also.
What's the best way to load data without any referential integrity or other issues.
Is it through SSMS import task easy or scripting way?
Table 1 ==> PK col + some columns
Table 2 ==> PK+ some columns + FK to TABLE1
Table 3 ==> PK+ some columns
Table 4 ==> PK + some columns + FK to TABLE2
Table 5 ==> PK + some columns + FK to TABLE2 and TABLE3
Table 6 ==> Kind of MAster Table which contains all other tables PK columns as FK + some other columns
Note: Some of other columns i have default value also like User (SUSER) and DAteCol is GETDATE()
Your input greatly appreciated!
Thanks
将其加载到临时表中的最佳方法然后从那里处理
请参考:
https://stackoverflow.com/questions/14247057/import-csv-into-sql-multiple-tables
希望这会有所帮助!
------------------------------------------- -------------------------------------------------- --------
请不要忘记" mark
回复为答案 " 如果他们帮助 ,也设置" 喜欢 "
这对我们保持博客提升 J
Please don't forget to "markthe replies as answers"if they helped, also set "like" it’s a boost for us to keep blogging J
点击 here 到
了解详情。访问专用 社区
foru m 到 分享 , 探索 和 talk &
关于Microsoft Kaizala的专家。
Click here to learn more. Visit the dedicated Community forum to share, explore and talk to experts about Microsoft Kaizala.