Monday, January 11, 2010

How to delete a large data on SQL server table

Some time we need to delete a large data and if we run the delete command as it's sometime this will not working properly or SQL Server will go to in recovery mode so let's see how we can delete a large data from SQL server table easily


2 comments:

Khaled Abrass said...

I think if you want to go with this solution and your table size is more than 50GB, I think, this process will go 1 or 2 months, but you can try the following way:
set rowscount 1;
truncate table x;

and this maybe will take seconds and then shrink your database.

Fadi Ahmad Abdulwahab said...

yes ,you are right and by this approach you just remove the pointer to this table and data of table will be removed by shrink