Insert Into SQL
AKA the Access Append Query
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
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