2013-07-04 101 views
0

我想在SSIS中使用SQL任务更新表,并且出现错误:无法绑定多部分标识符“a.SourceSystemKey”。SSIS SSQL任务错误

Update BMR_STAGE.dbo.STG_AL_VSAccountStatuses 
set a.SourceSystemKey = b.SourceSystemKey 
,a.SourceSystem = b.SourceSystem 
,a.NLCompany = b.NLCompany 
,a.AccountStatus = b.AccountStatus 
,a.Description = b.Description 
,a.InsertAuditKey = b.InsertAuditKey 
,a.UpdateAuditKey = b.UpdateAuditKey 
,a.ChangeDate = b.ChangeDate 
from BMR_STAGE.dbo.STG_AL_VSAccountStatuses a, BMR_STAGE.dbo.TMP_STG_AL_VSAccountStatuses b 
where a.ID =b.ID 

回答

0

该错误表明不存在称为a.SourceSystemKey的字段,或者该别名a在该范围内未被识别。尝试使用显式连接语法。

Update a 
set 
a.SourceSystemKey = b.SourceSystemKey 
,a.SourceSystem = b.SourceSystem 
,a.NLCompany = b.NLCompany 
,a.AccountStatus = b.AccountStatus 
,a.Description = b.Description 
,a.InsertAuditKey = b.InsertAuditKey 
,a.UpdateAuditKey = b.UpdateAuditKey 
,a.ChangeDate = b.ChangeDate 
from BMR_STAGE.dbo.STG_AL_VSAccountStatuses a inner join 
BMR_STAGE.dbo.TMP_STG_AL_VSAccountStatuses b on a.ID = b.ID