Question:
SQL statement problem about inserting record in a single sql view .? MS access?
sweet
2012-09-08 20:09:50 UTC
my professor ask us to code SQL statements to insert the following record for each of the tables.

what I wanted to do is to code all the record in a single sql view what I did was this one and unfortunately It says "characters found after end of SQL statement" or "syntax error on INSERT INTO statement"

now I want this two statements to be coded in a single form I use UNION but doesn't work either ..

INSERT INTO SERVICE (PropertyID,Initials,Date,HoursWorked)
VALUES (1,'LA1','8/28/2012','89');

INSERT INTO SERVICE
VALUES (2,'LA1','8/28/2012','98');




what is the exact or best way to resolve this problem...
Three answers:
VBA
2012-09-08 20:11:46 UTC
Please stop repeating your questions over and over. I already replied to this same question in your earlier post.
Serge M
2012-09-08 21:38:44 UTC
INSERT INTO SERVICE (PropertyID,Initials,Date,HoursWorked)

select 1,'LA1','8/28/2012','89'

UNION ALL

select 2,'LA1','8/28/2012','98'
ill
2016-08-01 06:56:07 UTC
For the assertion you have got to declare which columns you're inserting them into or else it tries to insert the values into all columns. Modify your code to the below: INSERT INTO ballot (query) VALUES ('experiment')


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...