我们最近从 Oracle 切换到 SQL Server,我们有这个旧的更新语句,它曾经可以工作,但现在给出错误“操作必须是可更新的查询”。那么查询类型设置为更新,我尝试以管理员身份运行它没有成功,我们能够运行选择语句没有问题,所以连接一定没问题吗?
我不确定我是否只是错过了一些非常简单的东西,因为我习惯于在 SSMS 而不是 Access 中工作。更新语句的代码如下:
UPDATE dbo_LEARNER_AIMS
INNER JOIN dbo_REGISTRATION_UNITS ON dbo_LEARNER_AIMS.RUL_CODE = dbo_REGISTRATION_UNITS.RUL_CODE
SET dbo_LEARNER_AIMS.END_DATE = [EXP_END_DATE],
dbo_LEARNER_AIMS.COMPLETION = "10",
dbo_LEARNER_AIMS.OUTCOME = "40",
dbo_REGISTRATION_UNITS.FES_PROGRESS_CODE = "EXT",
dbo_REGISTRATION_UNITS.FES_PROGRESS_DATE = [EXP_END_DATE],
dbo_REGISTRATION_UNITS.PROGRESS_STATUS = "X"
WHERE (((dbo_LEARNER_AIMS.END_DATE) Is Null)
AND ((dbo_LEARNER_AIMS.FUNDING_YEAR)="17")
AND ((dbo_LEARNER_AIMS.LEARNING_AIM) = [Enter Aim])
AND ((dbo_LEARNER_AIMS.EXP_END_DATE) Between #8/1/2012#
AND [enter expected end date]));
提前感谢任何答案。