Discussion Locked

How to Empty a Table in MS SQL 7.0

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a Table within MS SQL 7.0 that I need to empty the 47,000 records out of. I am wondering if there is a script or query that I can run to do this. I do not want to have to remove these manually.

Thanks

3 replies

by pramodpatil

Based on your requirement, Use either "Trucate Table" or 'Delete from" SQL Statments.

I am assuming that you need to "empty" the complete table. then you have a choice of above.

Otherwise use Delete conditionally.

Following is the difference between two commands in short,

Use ?TRUNCATE TABLE? statement instead of ?DELETE? clause if you want to delete all rows from a table. It is much faster then ?DELETE? statement without any conditions. ?TRUNCATE TABLE? frees all the space occupied by that table's data and indexes, without logging the individual row deletes.

This discussion is closed to new replies.