Discussion Locked

SQL Syntax

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

What is wrong with the syntax in the following line?

UPDATE tblContacts SET cName = 'Bob', SET cAddress = '494 Dale', SET cPhone = '494-0494' WHERE cID = '0'

I tried to run it using AND instead of commas and without the ticks before and after each of the new field values, but to no avail.

4 replies

by magicdress

you won't need the 'SET' keyword before each item--just a comma to separate them.

hth,
becky

by magicdress

whoops, clarification--one 'SET' is needed:

'UPDATE tblMyTable SET dog='Tiger', cat='Fluffy', mom='Carol', dad='Mike', housekeeper='Alice'

This discussion is closed to new replies.