Explain the similarities and differences between drop, delete, and truncate in SQL,
First: Similarities:
Truncate, delete without where clause, and drop both delete table data.
Second: Differences:
1. Truncate and delete: only delete data. Do not
SQL truncate, delete and drop differencesSame point:1.truncate and delete without a WHERE clause, and drop deletes the data in the table.2.drop, truncate are DDL statements (data definition language) that are automatically committed after
Same point:Truncate and delete without a WHERE clause, and drop will delete the data in the table different points: 1. Truncate and delete only delete data without deleting the structure of the table (definition)The drop statement will delete the
Differences between drop, delete, and truncate in oracle: droptruncate
Differences between drop, delete, and truncate in oracle you can use the drop, delete, and truncate commands to delete tables in the database, there are many articles and
In the SQL statement ---- delete table data drop, truncate, and delete usage, droptruncate
Reprinted from: http://www.cnblogs.com/1312mn/p/4422396.html
I. SQL syntax
1. drop table name eg: drop table dbo. Sys_Test2. truncate table name eg: truncate
The similarities between the three commands: truncate and delete without the where clause, and drop will delete the data in the table. The difference is that truncate will clear the table data table and set the id to start from 1, delete: only
The source of this article: http://www.cnblogs.com/wy123/p/6704619.htmlIssue backgroundIn a write SQL Server stored procedure, if a temporary table is defined in the stored procedure,Some people are used to explicitly delete a temporary table
Refer to others summary, this content only for oneself studyI. Syntax in SQL1.drop Table name Eg:drop table dbo. Sys_test2.truncate Table name eg:truncate table dbo. Sys_test3.delete from table name where column name = value Eg:delete from dbo.
The similarities between the three commands: truncate and delete without the where clause, and drop will delete the data in the table. The difference is that truncate will clear the table data table and set the id to start from 1, delete: only
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.