0

I have created a table called Customers with a CustomerID, Last Name, First Name, Address, and City, but when I tried to use the INSERT INTO to add data and ran the SQL Statement, it gives me an error: "Syntax error in CREATE TABLE statement". Below is the SQL Statement I have so far:

CREATE TABLE Customers
(
CustomerID int,
LastName varchar(50),
FirstName varchar(50),
Address varchar(50),
City varchar(50)
);

INSERT INTO (CustomerID, LastName, FirstName, Address, City) 
    VALUES ('10001', 'Smith', 'John', '1002 Danville Road', 'Louisville');

1 Answer 1

1

You are missing the table name from your INSERT statement:

INSERT INTO Customers (CustomerID, LastName, FirstName, Address, City)
VALUES ('10001', 'Smith', 'John', '1002 Danville Road', 'Louisville');

As to why you got an error pointing to your CREATE TABLE statement (which looks correct), my guess is that Access tried to connect the botched INSERT statement to the create in an effort to parse everything correctly.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.