I wanted to delete massive amount of data on a SQL Server 2005 table (about 80 millions of records). Without stating begin tran, I wrote my delete query like
Delete from myTable
where columnA > X'
where columnA is not the table’s primary key. It has been started since 4 hours ago and still not finished. I’ve tested in a similar scenario with similar number of rows and similar condition and the operation was done in about 70 minutes but meanwhile the main server is more powerful but it is not stopping after 4 hours being spent. The database has been configured to provide Full recovery model.
I want to know if I can stop this never ending operation by killing the SPID of the corresponding process, and If I done so, what happens? Will sql server start to rollback the operation? will the database gets suspended? What is the solution?
Yes, server will roll back the delete operation,
BUT
such a rollbacks usually take more time to finish, than time previously spent to operation.
DB will not be suspended, but lock on the table will be held until rollback finishes.