Home  Fees/Services   Access Templates   Tutorials   Tutorial Downloads   Articles  Search  Contact  Privacy  Links
Insert Query Statement Example SQL Insert Into  
Home > Tutorials > Query Tutorials > >Insert Into Query
 

 

 


Insert Into SQL

Tutorials for Access Queries

Insert into SQL command is SQL Query statement employed to append new records to a table in your relational database. The Access insert into query is synonymous with the append query.

The basic syntax of the SQL Insert Into query for a single record is:

Insert Into TableName (FieldName1, FieldName2) Values (Value1, Value2);

For multiple records gathered from other tables or external sources the Access insert into query is slightly different:

Insert Into TableName (FieldName1, FieldName2) Select FieldName1, FieldName2 From TableName;

The full syntax of the insert into query statement from Microsoft Access help is:

INSERT INTO target [IN externaldatabase] [(field1[, field2[, ...]])] SELECT [source.]field1[, field2[, ...] FROM tableexpression;

Where:

Insert Into

Note: The ending semicolon is a required component of all SQL statements.

Now the insert into SQL query with real column and table names for a single row:

Insert Into M_Employees (Emp_ID, Emp_Name, Emp_Start_Date) Values (00212, "Joseph Dean", #01/02/06#);

Note that text values are bounded by quote marks and date values are bounded by pound signs in the insert into query.

Multiple row inserts using the select statement alternative - a variation of the insert into query.

Insert Into M_Employees (Emp_ID, Emp_Name) Select Emp_ID, Emp_Name From MyLinkedSpreadsheet Where Emp_Status="New";

Note that we restrict the number of records to only those records with a status value of 'New".

More SQL Append Query Examples:

Docmd RunSQL Access SQL Append Query

Concatenate Records Insert Into Query


 

 

 

Microsoft Office:
MS Access 2003
Access 2007
Access 2010
Access 2013
 





Contact Information

Copyright 2000-2014 Blue Claw Database Design
Waterfront Home For Sale