AA (Id,name)
BB (ID. Address)
A change
1 Multi-table change
Change the address of name to Dawu;
Update AA A INNER join BB B on a.id=b.id
Set b.address= ' Dawu '
where a.name= ' name '
2 single Table
Update AA set aa.names= ' where XXX
Second deletion
1 drop
DROP TABLE TableName
drop table AA Deletes the content and definition, freeing up space. In short, the whole table AA is removed. It is not possible to add data in the future unless a new table is added
2 Delete
Delete from TableName where XX conditionally deletes the table's data or the entire sheet data. However, the custom identity column ID is not deleted, stating that delete delete does not free space
Delete from AA removes all data from the AA table.
Delete from AA where id = 1 delete data in AA table with ID equal to 1
3 truncate
TRUNCATE TABLE TableName
Delete the content, free up space, but do not delete the definition. Unlike drop, he simply empties the table data and does not delete the table structure. The Custom identity column ID is deleted, indicating that truncare delete frees up space. The ID will start at 1.
- The row data cannot be deleted, and the table must be cleared if it is deleted.
Truncate is faster than delete and uses less system and transaction log resources.
The table after the truncate operation is much faster than the table after the delete operation.
When the table is emptied, the table and table indexes are reset to their initial size, and delete cannot
SQL Server Pruning