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.
1 Answer
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.
GenActiveItemPriceList
might be poorly written. Or perhaps you ran some code prior to what you show on screen that ranBEGIN TRANSACTION
without having aROLLBACK
orCOMMIT
clause. On another note, why would you run this seemingly strange code against a production server without knowing the outcome?