Search code examples
sql-serverselectwarningsssmsautocommit

SQL Server Management Studio warns about uncommitted transactions even on selects


I've just started using SQL Server after years on Oracle - naturally the first thing I did was turn off autocommit in SQL Server Management Studio.

The "There are uncommitted transactions" warning is of course helpful in the case of a change, but I still see it even if all I've done is a single SELECT.

e.g. open session, run e.g. select 1 from Images, close query.

All I can think of is it might be trying to commit logging or update statistics...is there a way to turn off this warning for selects?

(I'm using SQL Server 2014 Express).

Thanks


Solution

  • According to documentation Implicit Transactions

    enter image description here

    In implicit transaction mode your SELECT opens a transaction as well and it cannot be changed. That is by design.

    So you'll continue to get warnings until you commit/rollback your SELECT statements