Sno.
|
Truncate
|
Delete
|
1
|
It is a DDL command
|
It's a DML command
|
2
|
DDL because it use schema lock
|
DML because it uses row level lock usually
|
3
|
Truncate doesn't support from and where clause
|
Delete supports from and where clause
|
4
|
syntax: Truncate table Emp
|
Syntax: Delete from table
Syntax: Delete from emp where id =10 |
5
|
Truncate is minimally logged operation makes it faster
|
It is fully logged operation makes it comparatively slow
|
6
|
It doesn't activate the table's after delete trigger.
|
It activate the table's after delete trigger
|
7
|
This resets identity key values
|
It doesn't impact identity key values
|
8
|
Truncate cant be roll back in transaction
|
Delete can be rolled back
|
9
|
You can't use TRUNCATE TABLE where the tables are referenced by a foreign key constraint
|
Delete can be used when the tables are referenced by a foreign key constraint
|
10
|
You can't use TRUNCATE TABLE where the tables participate in an indexed view.
|
Delete can be used when the tables participate in an indexed view.
|
11
|
You can't use TRUNCATE TABLE where the tables participate in transactional replication
|
Delete can be used when the tables participate in transactional replication
|
12
|
You can't use TRUNCATE TABLE where the tables participate in merge replication.
|
Delete can be used when the tables participate in merge replication.
|
13
|
It free the space containing the table.
|
It does not free the space containing the table.
|
14
|
TRUNCATE removes the data by deallocating the data pages
|
Delete just remove the data from pages / Pages
|
15
|
Truncate cannot be issued over a database link in Oracle
|
Delete can be issued over a database link
|
16
|
Truncate generates a good amount of redo transactions only
|
Delete generates a good amount of redo and undo transactions
|
Labels
- MSSQL (79)
- MSSQL Error (51)
- Slides (49)
- Analytics (41)
- Interview Questions (39)
- SQL (39)
- Data Science (35)
- ERP (34)
- Difference between (31)
- MSSQL Architecture (28)
- HADOOP (27)
- GCP (25)
- MSSQL Internals (25)
- Statistics (24)
- MSSQL Replication (22)
- Installation (21)
- Management (20)
- AWS (19)
- Windows (19)
- DBMS (17)
- Big Data (16)
- Finance (15)
- Indexes (15)
- NoSQL (15)
- Python (15)
- Spark (15)
- Demo (14)
- Machine learning (13)
- Analytics Lab (12)
- R (12)
- Hive (10)
- Marketing (10)
- MongoDB (10)
- Azure (9)
- GCP-LAB (9)
- MSSQL T-Log (9)
- pyspark (9)
- Business Intelligence (8)
- Business Process Re-engineering (8)
- MSSQL Protocols (8)
- Neo4J (8)
- Ubuntu (8)
- Accounting (7)
- Agile (7)
- Automation (7)
- EVS (7)
- Error (7)
- MSSQL Maintenance (7)
- MSSQL Cluster (6)
- MSSQL Stats (6)
- Macroeconomics (6)
- PDW (6)
- Pig (6)
- EXCEL (5)
- Marketing Analytics (5)
- Tableau (5)
- visualization (5)
- Kubernetes (4)
- Memory (4)
- Power Shell (4)
- SSRS (4)
- CSM (3)
- HR Analytics (3)
- Hcatalog (3)
- High Availability (3)
- Must Read (3)
- Performance Issues (3)
- Dumps (2)
- Elastic-search (2)
- Firewall (2)
- Hyper-V (2)
- ITIL (2)
- MYSQL (2)
- Power BI (2)
- Robocopy (2)
- SPN (2)
- SSAS (2)
- SSIS (2)
- Sqoop (2)
- Storm (2)
- CAM (1)
- Online Tutorial (1)
- Organ donation (1)
- PostgreSQL (1)
Difference Between Truncate and Delete
Subscribe to:
Post Comments (Atom)
No comments:
Write commentsPlease do not enter spam links