SQL error message

1andyw

Registered User.
Local time
Today, 01:21
Joined
Feb 15, 2004
Messages
12
My query reads:

"CREATE TABLE customers (id INT auto_increment, name VARCHAR(25))"

Access returns a msg box 'Syntax error' and highlights the word 'auto'.
What is the correct syntax for the auto_number field?
 
CREATE TABLE customers (id autoincrement, name VARCHAR(25))
 
Thanks, Jon. I have the table created successfully. To populate the table I wrote:
"INSERT INTO customers
VALUES ("Jones")".
The message box says I did not include enough fields. How would you word the sql to populate one or more new records?

Andy
 
INSERT INTO customers ([Name]) VALUES ("Jones")

VALUES can insert only one record. You can insert more than one record from another table using SELECT:-

INSERT INTO customers ([Name]) SELECT [Name] from [AnotherTable]
 

Users who are viewing this thread

Back
Top Bottom