UPDATE query gives Incorrect Syntax error



Hi all

I'm running SQL Server 2005 Express Edition.
One database
One table called Sites
Fields as follows:
id (bigint, Identity, Primary Key)
SiteName (varchar(50), allows nulls)
Generation (float)
LastUpdated (varchar(50), allows nulls)

At present there are only three records in this table.

My VB application connects via ODBC (using Named Pipes) no problems.
SELECT queries run as expected and return appropriate records.
When I run an UPDATE query like this one:
UPDATE Sites SET (Generation = 44) WHERE (SiteName = 'Test')
I get the following error:
-2147217900 [Microsoft][ODBC SQL Server Driver][SQL
Server]Incorrect syntax near '26'.

Now the funny thing is that the field LastUpdated did contain
'26/08/2008' but I have changed the field value and still get the same
error message.
Restarting SQL Server does not fix the problem nor does rebooting the
machine.
The query works perfectly from inside the Management Studio but not
via ODBC.
The ODBC connection is fine so I don't think this is a security/
permissions problem.

I'd appreciate some advice.

Chris
.



Relevant Pages

  • Re: How to have SQL_ERROR returned from RAISERROR within IF-BLOCK
    ... The problem has been fixed in SQL Server 2005. ... even modify the sequence of ODBC function calls and checking of the return ... I want to return SQL_ERROR to my application with a custom error message ... I get it returned fine when I execute the following statement using ...
    (microsoft.public.data.odbc)
  • Re: UPDATE query gives Incorrect Syntax error
    ... LastUpdated, allows nulls) ... My VB application connects via ODBC no problems. ... Restarting SQL Server does not fix the problem nor does rebooting the ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)
  • Re: sql server + ODBC: error suppressed
    ... I have a program that connects to SQL Server through ODBC, one of my clients ... no error message is displayed either (which is strange and it works fine on ... are there any configuration parameters on sql server or ODBC ...
    (microsoft.public.sqlserver.server)
  • Linked server to ODBC dsn.....
    ... Using my favorite ODBC sql query tool, i can select the System DSN, specify ... i go into SQL Server, and want to create a linked server to this same ODBC ... the error message really shouldn't matter. ...
    (microsoft.public.sqlserver.server)
  • ODBC con error
    ... We have an Access 2003 application that connects to SQL Server 2000 via ODBC ... One network user is getting the following error message ...
    (microsoft.public.sqlserver.odbc)