Home  Fees/Services  Access Examples  Tutorials  Access Download  Articles  Search  Contact  Privacy  Links

Access Query Examples
SQL Delete Query Example

Delete Query Tutorial SQL Queries

Access Database Tutorials>SQL Queries>Access Delete Query

Download Access Program


Aggregate Functions
Child/Parent Table Query
Choose Function
SQL Choose Function +
Crosstab/Pivot Query
SQL Crosstab Query +
DateTime Query
SQL Delete Query
External Link to Tables
Filter Report Records
Group By Clause
Having Clause Query
Histogram Query
Insert Into Query/Append
Master/Detail Updates
SQL Order By Dynamic
Parameter Query
SQL Predicate Example
Self Join Query
Access Scalar Query
Select Statement
Select Top 1 Query
Union Query Example
Update Query Example


Delete Query

The SQL Delete query in MS Access is a DML (data manipulation language) command used to remove one or more rows of data from a relational database table.  The number of rows deleted is dependent upon the existence and criteria within the where clause of the delete query.

The basic syntax of the SQL Delete query is:

Delete TableName.* From TableName Where somecriteria;

Note that using a delete query without the where clause will delete all rows from the specified table.

The asterisk in TableName.* is a wildcard character and refers to all fields within the table.  You may only delete entire records rather than values in particular fields therefore the asterisk is mandatory.

If TableName is a table which is defined as the master of a master-detail relationship and the cascade delete property of the relationship is set to true then corresponding records in the detail table will also be deleted.

The delete method is often preferable to the drop table method because all of the characteristics of the remain intact - such as the indexes, relationships and primary keys.

Now with real column and table names:

Delete *  From M_Employees Where  Emp_Name = "Joe";

The above query will delete all employees with an employee name of Joe.

More Delete Query Examples:

Docmd RunSQL Access Database Example

Examples are Update, Delete, Insert Into, etc., queries. ... RunSQL "Delete * from t_orders" ' 'create and run the append queries ...
www.blueclaw-db.com/docmd_runsql_example.htm


Visual Basic Select Case in Access

RunSQL "delete * from mailmerge in '" & pitney & "'" sqltext = "INSERT INTO mailmerge (name,address1,address2,city,state,zip) in '" & pitney & "'" & _ ...
www.blueclaw-db.com/select_case.htm


Concatenate Records Text Field

RunSQL ("delete * from t_patient_alrgy") ' start creating new list ' select list of records for this patient Set rst = db.OpenRecordset("SELECT Allergy " & ...
www.blueclaw-db.com/concatenate_multiple_records_one_field.htm


 

We now offer web-based SQL/Server application development in partnership with Integrated Databases, Inc. (new projects only).



Contact Information

SQL Queries
MS Access SQL Queries 2007 2003 2000  All Windows Versions