title: Incorrect Syntax Near '('
body: <p>can anybody tell me why the following code produces the error:</p>
  
  <pre><code>cQueryIS = "UPDATE Additional (StaffEUPN, Class, Additional1, Additional2, Additional3, Additional4,AdditionalLarge1, AdditionalLarge2, AdditionalLarge3, AdditionalLarge4)  "
  
  cQueryIS &amp;= "VALUES (@cSTEupn, @cClass, @cAdditional1, @cAdditional2, @cAdditional3, @cAdditional4, @cAdditionalLarge1, @cAdditionalLarge2, @cAdditionalLarge3, @cAdditionalLarge4) "
  
  cQueryIS &amp;= "WHERE StaffEUPN = '" &amp; cStaffEUPN &amp; "' AND Class = '" &amp; cClass &amp; "'"
  </code></pre>
  
  <p>However this code works:</p>
  
  <pre><code>cQueryIS = "UPDATE Additional SET StaffEUPN=@cSTEupn, Class=@cClass, 
  Additional1=@cAdditional1, Additional2=@cAdditional2, Additional3=@cAdditional3,
  Additional4=@cAdditional4, AdditionalLarge1=@cAdditionalLarge1, 
  AdditionalLarge2=@cAdditionalLarge2, AdditionalLarge3=@cAdditionalLarge3, 
  AdditionalLarge4=@cAdditionalLarge4  "
  
  cQueryIS &amp;= "WHERE StaffEUPN = '" &amp; cStaffEUPN &amp; "' AND Class = '" 
  &amp; cClass &amp; "'"
  </code></pre>
  
  <p>I am a bit confused as the way I did it first works fine on an <code>INSERT</code> command and only causes the error on an <code>UPDATE</code>.</p>
  
  <p>Here is the rest of the code:</p>
  
  <pre><code>        Using dbConnectionSQL As New SqlConnection(dbConnectionString)
              Using comm As New SqlCommand()
                  With comm
                      .Connection = dbConnectionSQL
                      .CommandType = CommandType.Text
                      .CommandText = cQueryIS
                      .Parameters.AddWithValue("@cSTEupn", cStaffEUPN)
                      .Parameters.AddWithValue("@cClass", cClass)
                      .Parameters.AddWithValue("@cAdditional1", ProvisionAdditional(1))
                      .Parameters.AddWithValue("@cAdditional2", ProvisionAdditional(2))
                      .Parameters.AddWithValue("@cAdditional3", ProvisionAdditional(3))
                      .Parameters.AddWithValue("@cAdditional4", ProvisionAdditional(4))
                      .Parameters.AddWithValue("@cAdditionalLarge1", ProvisionAdditional(5))
                      .Parameters.AddWithValue("@cAdditionalLarge2", ProvisionAdditional(6))
                      .Parameters.AddWithValue("@cAdditionalLarge3", ProvisionAdditional(7))
                      .Parameters.AddWithValue("@cAdditionalLarge4", ProvisionAdditional(8))
                  End With
                  Try
                      dbConnectionSQL.Open()
                      comm.ExecuteNonQuery()
                  Catch ex As SqlException
                      WriteToLogFile("Update Additional", ex.Message.ToString())
                      MsgBox("Update Additional - " &amp; ex.Message.ToString())
                      Exit Sub
                  End Try
              End Using
          End Using
  </code></pre>