1

I executed a stored procedure on the production server; and though it shows that query has been successfully completed it doesn't allow me to close SQL Server Management Studio and the below warning message is shown. Please advice I'm more concerned because this is the production server.

Query_Window

Close SSM

3
  • It seems like a transaction was started but not committed. Were you running previous queries with begin transaction?
    – Ben
    Commented Jan 6, 2015 at 5:39
  • Looks to me like GenActiveItemPriceList might be poorly written. Or perhaps you ran some code prior to what you show on screen that ran BEGIN TRANSACTION without having a ROLLBACK or COMMIT clause. On another note, why would you run this seemingly strange code against a production server without knowing the outcome?
    – Hannah Vernon
    Commented Jan 6, 2015 at 5:58
  • @MaxVernon I actually performed some manual updates to the Price-list table & this SP had to be executed after my manual update what it actually does is that there is a column as (IsActive) and it updates either (0 OR 1)Based on the Active dates of the Price-lists
    – Heisenberg
    Commented Jan 6, 2015 at 6:07

1 Answer 1

2

When you are closing SSMS, it check for

IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION

Or you can use sys.dm_exec_requests

SELECT open_transaction_count FROM sys.dm_exec_requests WHERE session_id = @SessionId

In this case you have an open transaction so on connection closure process SQL Server will roll back that transaction. In this case you need to take a look at the stored procdure dbo.GenActiveItemPriceList and identify what is this transaction is which is not commited and it's furter impact.

Not the answer you're looking for? Browse other questions tagged or ask your own question.