Thursday 10 July 2014

SQL Delete Truncate Drop

Delete and Truncate
Delete from <tablename> where ID=2
Truncate table <tableName> will delete all rows
Delete table <tableName> will delete all rows
Delete we can apply where condition. To perform this Delete action it will take some time, where as truncate will with in seconds,
truncate we can not apply where condition, it will delete all records.

Delete and Drop
Delete table <tableName> will delete all rows, but table structure will be there
drop table <tablename> Will delete table structure