0

我正在尝试使用 SSIS 中的 SQL 任务更新表,但出现错误:无法绑定多部分标识符“a.SourceSystemKey”。

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
4

1 回答 1

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
于 2013-07-04T20:05:17.837 回答