我正在结合使用access和sql server。我的主表位于 sql server 中,临时表是在 access 中创建的。我正在尝试通过连接 sql server 中的表来更新 access 中的临时表。但我不断收到错误,操作必须使用可更新的查询。下面是我的查询。任何帮助将不胜感激。
UPDATE [tmpEditErrCode220 - 2] INNER JOIN dbo_Indicator_0 ON ([tmpEditErrCode220 - 2].cpt_code_allow = dbo_Indicator_0.cpt_code_allow) AND ([tmpEditErrCode220 - 2].cpt_code_omit = dbo_Indicator_0.cpt_code_omit) SET [tmpEditErrCode220 - 2].flag = On
WHERE ((([tmpEditErrCode220 - 2].flag)=Off));
试试这个
UPDATE dbo_Indicator_0
INNER JOIN
[tmpEditErrCode220 - 2] ON ([dbo_Indicator_0].cpt_code_omit = [tmpEditErrCode220 - 2].cpt_code_omit) AND ([dbo_Indicator_0].cpt_code_allow = [tmpEditErrCode220 - 2].cpt_code_allow)
SET [tmpEditErrCode220 - 2].flag = "On"
WHERE ((([tmpEditErrCode220 - 2].flag)="off"));
UPDATE tmpEditErrCode220
SET [tmpEditErrCode220 - 2].flag = "On"
FROM [dbo_Indicator_0]
WHERE [dbo_Indicator_0].cpt_code_omit = [tmpEditErrCode220 - 2].cpt_code_omit
AND [dbo_Indicator_0].cpt_code_allow = [tmpEditErrCode220 - 2].cpt_code_allow
WHERE [tmpEditErrCode220 - 2].flag = "Off";