com.microsoft.sqlserver.jdbc.SQLServerException:','附近的语法不正确

时间:2014-01-27 21:17:12

标签: sql sql-server jdbc

获取执行以下查询的错误:

UPDATE ETA.dbo.GK_Tasks 
SET TaskName='Identify appropriate tests/coverage', 
  Assignee='Linda/Cathy/testing', 
  StartDate='', 
  AntpCompleteDate='2014-01-10 00:00:00.0', 
  ActlComplDate='', 
  Status='Setup meeting with Linda/Cathy to review existing scripts and identify any additional required scripts', 
  Notes='Critical task to ensure that the automated tests are successful in capturing critical defects', 
  TaskSortID='1' 
WHERE ID='1', ProgramID='1', InitativeID='4'

我是SQL查询的新手。谢谢!

2 个答案:

答案 0 :(得分:1)

您在每个AND子句条件之间缺少WHERE。如果您有多个条件,则可以使用AND / OR - 您不会在条件之间使用逗号。

而不是:

WHERE ID='1', ProgramID='1', InitativeID='4'

您需要使用:

WHERE ID='1' 
  AND ProgramID='1'
  AND InitativeID='4'

答案 1 :(得分:0)

更改此部分:

WHERE ID='1' AND ProgramID='1' AND InitativeID='4'