Tutorials

SQL Table


SQL Truncate Table


TRUNCATE TABLE in SQL helps us to delete all rows from the table at a time.

It doesnot use WHERE clause.

Syntax of TRUNCATE Table

TRUNCATE TABLE table_name;

Example on TRUNCATE Table

We have the table 'tih_Courses' as shown below:

tih_Courses
Course_ID Course_Name Professor Mode_of_Training
001 .Net Mukesh Tiwari Online and Offline
002 Java Rajneesh Shukla Online and Offline
003 ANSI SQL Rajneesh Shukla Online
004 Basics of Computer Shweta  Online  

We will apply TRUNCATE statement on this table

 


TRUNCATE TABLE tih_Courses;

All the rows will get deleted from the tih_Courses table on successful execution of above sql query.



Please Share this page
Views : 117
Like every other website we use cookies. By using our site you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. Learn more Got it!