-1
UPDATE project_phases p2 
SET 
  p2.ClartiyID = @ClarityID,
  p2.Start_date = @start_date,
  p2.End_date = @End_date,
  p2.Planned_efforts = @Planned_efforts 
FROM 
  WSR.dbo.project_phases p2 
  INNER JOIN WSR.dbo.tb_Project p1 ON p1.ProjectID=p2.ProjectID 
WHERE 
  ProjectID = @ProjectID

但是即使找到该表,错误仍然显示,例如找不到对象名称

4

1 回答 1

1

如果这是您的全部查询,为什么要链接到 tb_Project?似乎这只是为了过滤 ProjectID,但此列在 Project_Phases 中,所以你不能忘记 INNER JOIN 并只使用:

UPDATE project_phases 
SET 
  ClartiyID = @ClarityID,
  Start_date = @start_date,
  End_date = @End_date,
  Planned_efforts = @Planned_efforts 
WHERE 
  ProjectID = @ProjectID
于 2012-05-21T10:06:45.233 回答