Introduction:

In this article we will explain how to remove all record from the table in SQL Server with example.

Description:

The SQL truncate table command is used to remove all rows (complete data) from a table. It is similar to delete statement , delete statement can use where clause but truncate statement can not use where clause.

Let's see the syntax to truncate the table from the database.

TRUNCATE TABLE table_name;

For example, you can write following statement to truncate the data of student table.

truncate table Student

Note:- SQL Truncate table command remove all rows (complete data) from a table and Reset identity columns but delete table command also remove all rows (complete data) from a table but  delete table command dose not reset identity column.

I hope this article will help to you.

0 comments


Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.

Welcome to SQL Tutorials Point

Don't have an account? Click here to Create a new account, it takes less than a minute.