SQL insert syntax for complete row

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using an "INSERT INTO" statment...
is there a quick syntax for adding a complete row from one table to another
(Yes, the fields are exactly the same) without having to name each field?

Also...
Using an UPDATE statement
is there a quick way to update a record with the complete contents of the
same record from another table?

These would be extremely useful for a manual synchronize that I have to write.
 
Hi.
Using an "INSERT INTO" statment...
is there a quick syntax for adding a complete row from one table to another

Try:

INSERT INTO tblDestination
SELECT *
FROM tblSource;
Using an UPDATE statement
is there a quick way to update a record with the complete contents of the
same record from another table?

No. You must name the individual fields and set their values.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact info.
 

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

Back
Top