2013-07-04 135 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