Working with Truncate
•
Version: 9.2 R04
Some tooltip text!
• 1 minute to read
• 1 minute to read
This method is used to remove all records in a table. All records afterward are irrecoverable. It is extremely fast, dependent on table size.
Warning
This will truncate the whole table, but won't delete the table itself.
Truncate Examples
using SuperOffice.WebApi;
using SuperOffice.WebApi.Data;
using SuperOffice.WebApi.Agents;
// set up the DatabaseTable agent
WebApiOptions options = //Get WebApiOptions with SystemUser Authorization
DatabaseTableAgent dta = new DatabaseTableAgent(options);
// table name
string tableName = "y_rental";
MassOperationResult massResult = await dta.TruncateAsync(tableName);
if(massResult.Success)
{
Console.WriteLine($"Removed {massResult.Deletes} records from {tableName}.");
}