Advertisements
Home > DB Concepts, SQL Server Questions > Stopping a DELETE statement in middle of its execution – MSDN TSQL forum

Stopping a DELETE statement in middle of its execution – MSDN TSQL forum


 
–> Question:

I accidentally executed the DELETE statement for a table.

However, I stopped it before it completed.

What effect will this have on the table in Database, is my data safe?
 

–> My Answer:

In SQL Server by default a single SQL statement is bounded within a Transaction.

So, if you cancelled the DELETE statement execution in between it would have cancelled the overall deletion from the table. So either all of your rows are safe or all gone. SQL Server ensures that a transaction should be completed fully or not at all, one of the ACID properties.


Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: