1

I am currently trying to insert a new row of information into a table, and am using the sql view inside of MS Access. When I run this code:

SELECT *
FROM VersionReleases;

INSERT INTO
  VersionReleases(CurrentVersionID, PreviousVersionID, ScriptID, ReleaseDate)
VALUES
  (555, 556, 1543, 2018);

It gives me an error specified in title, and I can't understand why. Would appreciate some guidance, thanks a bunch.

0

3 Answers 3

2

Just drop the SELECT statement. It is of no use here.

INSERT INTO VersionReleases
    (CurrentVersionID, PreviousVersionID, ScriptID, ReleaseDate)
VALUES
    (555, 556, 1543, 2018);
0

MS Access only supports the evaluation of one SQL statement; hence anything following a semi-colon delineating the end of a SQL statement will result in MS Access reporting the error:

Characters found after end of SQL statement

enter image description here

As such, your query will need to become either:

SELECT * FROM VersionReleases;

Or:

INSERT INTO
    VersionReleases(CurrentVersionID, PreviousVersionID, ScriptID, ReleaseDate)
VALUES
    (555, 556, 1543, 2018);

With a new query created to contain the other SQL statement.

0

Use "go":

INSERT INTO employees (id, fi)
VALUES (1970, 'dfewf');
go
INSERT INTO employees (id, fi)
VALUES (1485, 'edwewrew');
go
INSERT INTO employees (id, fi)
VALUES (1719, 'fwefwefw');

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .