What happens if a stored procedure is run in SSMS and it crashes

sql-server-2005ssms

What happens if a stored procedure is run in sql server management studio (SSMS 2012 to 2005 server) and it crashes?

I'm guessing the stored procedure continues to run?

On the other hand I have read somewhere that if a connection is lost and a transaction is used, then the transaction automatically rolls back?

Best Answer

If connection is lost, your session will be closed and all transactions will be rolled back. If you want to run your procedure without interruption, you could execute it as a job.