TRUNCATE method is used to delete existing records in a table like DELETE. This process also executes the UPDATE STATISTICS for tables, after DELETE operation.
This method may needs some privilege according to the database product and its version.
Examples
Following section demonstrates TRUNCATE the table(s).
{{hl}}var ddl = connection.DDL();{{/hl}}
// by table alias
var t0 = new Orders().AsQueryable();
var t1 = new OrderDetails().AsQueryable();
ddl.{{hl}}TruncateTable(t0){{/hl}}; // single
ddl.{{hl}}TruncateTable(new [] {t0, t1}){{/hl}}; // multi
// by table type
ddl.{{hl}}TruncateTable<Orders>(){{/hl}};
// by table name
ddl.{{hl}}TruncateTable("table1"){{/hl}};