posted 6/21/2009 by Vijendra Shakya
Truncate: Truncate is DDL (Data definition language) command. We can’t use where clause with truncate command. Once table is truncate we can’t rollback the data because it released the data from the memory. Truncate is faster than Delete because we can’t rollback the data in truncate and we can’t use the where clause. Truncate resets identity of the table.Syntax: Truncate table TableNameDelete: Delete is DML (Data manipulation language) Command. In Delete we can use the where clause and rollback the deleted data. Delete check constraints, if a constraint exists then it shows error. It is slower than truncateSyntax: Delete from TableName (this command deletes all record from the table) Delete from TableName Where ColumnName =YourCondition (It delete those record where given condition is match)
What kind of email newsletter would you prefer to receive from CodeAsp.Net?18