insert procedure error message

G

Guest

I have an access 2000 database (with the adp extension, so it's actually a
SQL database) and I'm am trying to "append" data from a view to a table.
Both have the same number of fields, each are the same field types, however
the following Procedure says bad things about the proc ADO error: Incorrect
syntax near the keyword 'INSERT'.

Create Procedure "ProcName"

INSERT "tablename" (field_1, field_2, field_3)
SELECT field_1, field_2, field_3
FROM "viewname"

Help
 
J

John Nurick

I don't know about T-SQL, but in Jet SQL that would be INSERT INTO,
wouldn't it?
 
J

John Nurick

Are you actually using double quotes round the names of the table and
view? That produces syntax errors in Jet SQL.
 
G

Guest

no quote marks. Same statement without the Create Procedure line works in
SQL Query Analyser.
 
J

John Nurick

Isn't there some sort of terminator needed between the CREATE PROCEDURE
statement and what in another language would be the body of the
procedure? Like AS? You'd better check in BOL or MSDN: they're a far
better source of SQL Server information than I am.
 
G

Guest

Yep the AS word was needed. Thanks

John Nurick said:
Isn't there some sort of terminator needed between the CREATE PROCEDURE
statement and what in another language would be the body of the
procedure? Like AS? You'd better check in BOL or MSDN: they're a far
better source of SQL Server information than I am.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top