Total Page Preview:   000000003003

What is the difference between delete and truncate statements in SQL in English and Hindi

 

Differnce between delete and truncate statement in English

DELETE and TRUNCATE are two different SQL statements used to remove data from a database table, but they differ in their functionality and usage.

1-DELETE Statement:
The DELETE statement is used to remove one or more rows from a table. It allows you to specify a condition for which rows to delete. It can be rolled back using a transaction if needed. It also triggers any associated triggers or constraints.
Syntax:
 
2-TRUNCATE Statement:
The TRUNCATE statement is used to remove all rows from a table in one go. It is faster than DELETE because it removes the data by releasing the storage space used by the table, rather than removing each row one by one. It cannot be rolled back using a transaction. It also resets the identity of the table, which means the next time a new row is added to the table, the identity column value starts from the beginning.
Syntax:

In summary, DELETE and TRUNCATE statements are both used to remove data from a database table, but they differ in functionality and usage. DELETE is slower but allows the removal of specific rows based on a condition and can be rolled back, while TRUNCATE is faster, removes all rows from a table, resets the identity column value, and cannot be rolled back.

 

 

Differnce between delete and truncate statement in Hindi

Yahan mai SQL ke DELETE aur TRUNCATE statements ke beech ke antar ko tabular form mein batata hoon:

Is tarah, DELETE aur TRUNCATE statements dono hi database table se data ko hataane ke liye kaam aate hain, lekin inmein antar hota hai. DELETE statement slow hota hai lekin specific rows ko condition ke basis par remove karne ki anumati deta hai aur undo kiya jaa sakta hai, jabki TRUNCATE statement fast hota hai, table se sabhi rows ko remove karta hai, identity column value ko reset karta hai aur undo kiya nahi jaa sakta hai.

 

 

 

Thank You

About Author

Brijesh Kumar

Database Developer

I have more then 6 years Experience in Microsoft Technologies - SQL Server Database, ETL Azure Cloud - Azure SQL Database, CosmosDB, Azure Data Factory, PowerBI, Web Job, Azure Function, Azure Storage, Web Apps, Powershall and Database Migration On-Premise to Azure Cloud.
LinkedIn : https://www.linkedin.com



Comments


                           
                           

                           

                           

Facebook User: