问题描述
我想将文件中的数据插入到这个模型的表 Division 中,这是非常简化的:
I would like to insert data from a file into the table Division of this model which is very much simplified:
这里 Division 是 Item 的子对象,Item 是 Statements 的子对象.原始数据如下所示:
Here Division is a child object of Item and Item is a child object of Statements. The original data looks like this:
结果应该是:
我认为前进的方向是使用 OUTPUT 但我不知道如何在这种相当复杂的情况下使用它(我知道如何进行批量插入等)
I think the way forward is to use OUTPUT but I don’t know how to use it in this fairly complicated case (I know how to do a bulk insert etc.)
期待任何反馈.谢谢.
最好的祝福,
基督徒
推荐答案
我目前正在使用循环来实现这一点,这是一种解决方案,但速度很慢.真的没有基于集合的方法吗?谢谢!
I am currently using loops to achieve this which is kind of a solution but very slow. Is there really no set based approach? Thanks!
基督徒
这篇关于将数据插入多个表 - 可能使用 OUTPUT - sql server 2005的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!