Groups | Blog | Home
all groups > sql server (microsoft) > july 2005 >

sql server (microsoft) : Invalid column name



Brad O
7/28/2005 2:11:38 PM
Why would this query give me a problem
UPDATE TABLE SET ALINK="FFFFFF" WHERE DisplayID=1
when
SELECT ALINK FROM TABLE
does not?

I get this error message:

Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver][SQLServer]Invalid column name
'FFFFFF'.


The error message indicates that it thinks the value on the right side of
the equation is a column name and not a column value.

Any ideas?

David Portas
7/28/2005 10:50:00 PM
Use single quotes instead of double:

UPDATE TABLE SET ALINK='FFFFFF'
...

By default double quotes are assumed to delimit identifiers, not strings.
Although it is possible to reconfigure that behaviour the standard in SQL is
to use single quotes for string literals.

--
David Portas
SQL Server MVP
--

Brad O
7/29/2005 7:41:09 AM
Thank you, that is a great help.


[quoted text, click to view]

AddThis Social Bookmark Button