由于目标表的架构更改,插入批量失败

use*_*384 2 ssis

select
   FiscalMonthID = (select FiscalMonthID from CurrentFiscalMonth (nolock)),
   T.OrgKey,
   DataSourceKey = 26,
   OrganizationTypeKey = 2,
   SourceSystemID = MAX(T.MbsId),
   WEGFlag = convert(bit,0),
   D.CreateDT,
   D.CreateBy,
   D.UpdateDT,
   D.UpdateBy

from WorkDB.dbo.TempMbsOrgMap (nolock) as T
join WorkDB.dbo.MBSOrganization_Denorm2 (nolock) as D
      on T.MbsId = D.OrganizationID
--where OrgKey not in (select OrgKey from OrgMap where FiscalMonthID=258 and DataSourceKey=26 and OrganizationTypeKey=2)
group by
   T.OrgKey,
   D.CreateDT,
   D.CreateBy,
   D.UpdateDT,
   D.UpdateBy
Run Code Online (Sandbox Code Playgroud)

小智 10

我不知道这个人是否解决了这个问题.如果有其他人遇到此错误,我到目前为止找到的最有用的文章是:http: //blogs.msdn.com/b/sqlserverfaq/archive/2009/11/04/s.aspx

文章中的建议(虽然值得一读)但如下:

以下是您可以尝试的一些行动计划,但这在我的案例中有所帮助.

1)在BCP运行之前删除约束,并在运行后重新创建它们

2)禁用自动更新统计信息(隔离问题)

3)检查是否有任何并行索引重建.

如果在实施上述更改后问题仍然存在,请收集Profiler跟踪以在bcp未能进一步调查时捕获活动.