为什么 SSIS OLE DB 命令转换不将所有记录插入表中?
我有一个 SSIS 包,它从 SQL 数据库中的表中获取数据,然后将数据插入(或更新现有行)到另一个数据库的表中。
这是我的问题,在查找
之后,我插入或更新行,但插入插入的行中有一半以上没有添加到表中。
对于插入,我使用 Ole Db Command 对象,其中使用我已经测试过的插入命令。我发现了为什么程序包在没有错误通知的情况下运行,但仍然没有插入表中的所有行。
我已经检查了 sqlProfiler,它说该命令是 RCP:Completed ,我认为这意味着它应该有效。
如果我在 sql management studio 中使用 sql profiler 提供的数据手动执行插入(它使用的值来执行插入语句),它就会起作用。我已经检查了数据,一切似乎都很好(未插入的行中没有非法数据)。
我完全不知道如何解决这个问题,有人有想法吗?
I have an SSIS package that takes data from Tables in an SQL database and insert (or update existing rows) in a table that is another database.
Here is my problem, after the lookup
, I either insert or update the rows but over half of the rows that goes into the insert are not added to the table.
For the insert, I am using an Ole Db Command object in which I use an insert command that I have tested. I found out why the package was running without error notification but still not inserting all the rows in the Table.
I have checked in sqlProfiler and it says the command was RCP:Completed which I assume means it supposedly worked.
If I do the insert manually in sql management studio with the data the sql profiler gives me (the values it uses toe execute the insert statement with), it works. I have checked the data and everything seems fine (no illegal data in the rows that are not inserted).
I am totally lost as to how to fix this, anyone has an idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 OLE DB 命令而不是 OLE DB 目标来插入记录有什么具体原因吗?
编辑 1:
因此,您会看到从查找转换匹配输出发送到 OLE DB 目标的 x 行(例如 100 行),但仅插入 y 行(例如 60 行)。这是正确的吗?不要插入到实际的目标表中,而是尝试插入到虚拟表中以查看所有行是否都正确重定向。您可以通过单击 OLE DB 目标上的“新建...”按钮来创建虚拟表。它将为您创建一个与输入列匹配的表。这可能有助于缩小问题范围。
编辑2:
您尝试使用的表的名称是什么?我认为这并不重要。我只是好奇这个名字是否是任何保留关键字。我能想到的另一件事是是否有任何其他进程可能会在目标表上触发某些操作(无论是在包内还是在包外)?我怀疑其他进程可能正在从表中删除行。
Any specific reason to use OLE DB Command instead of OLE DB Destination to insert the records?
EDIT 1:
So, you are seeing x rows (say 100) sent from Lookup transformation match output to the OLE DB destination but only y rows (say 60) are being inserted. Is that correct? Instead of inserting into your actual destination table, try to insert into a dummy table to see if all the rows are being redirected correctly. You can create a dummy table by clicking on the New... button on the OLE DB destination. It will create a table for you matching the input columns. That might help to narrow down the issue.
EDIT 2:
What is the name of the table that you are trying to use? I don't think that it matters. I am just curious if the name is any reserved keyword. One other thing that I can think of is whether there are any other processes that might trigger some action on your destination table (either from within the package or outside of the package)? I suspect that some other process might be deleting the rows from the table.