Using TRUNCATE TABLE in SQL

Right now, will find out about TRUNCATE TABLE to erase total information from a current table in SQL.

There are times when you need to erase the entire records from the table yet additionally to keep the table. Presently, we can’t do this by dropping the table itself as we will lose the table itself.

To make this conceivable to really keep the table we need shorten the table by a SQL question. This has a straightforward syntax since we should simply to utilize the shorten watchword and give it a TableName.

TRUNCATE TABLE table_name;

This is sufficient to erase each record from the table. There are situations when you truly don’t have any route other than erasing each record individually, which could be hard. Henceforth, learning this inquiry will help you a great deal.

Sham information:

Syntax:

TRUNCATE TABLE  table_name;

Example 1:

TRUNCATE TABLE 'JustTechReview'.'employee';

Example 2:

TRUNCATE TABLE ' JustTechReview'.'company';

Leave a Comment

error: Alert: Content is protected!!