How to delete all records from any Standard /Custom object using SOQL.

You are currently viewing How to delete all records from any Standard /Custom object using SOQL.
How to delete all records from any Standard /Custom object using SOQL.

Suppose that you have created some records on any object and you want to delete all record at one time.

Here is code that you can run from your developer console or apex program.

List l = [SELECT id from Account];
delete l;

Using this code you can delete records from your standard or custom object.

Before execute NOTE : that this code will delete all record at one time . No record will be there on object after you execute this code.

Watch the following video where I have implemented and explained same concept

How to delete all records from any Standard /Custom object using SOQL.

Leave a Reply