New answers tagged process
Uncommitted transactions are held open until the connection is terminated, and then they are rolled-back. So in connection-pooling scenarios, they will he held open longer since the connection has not terminated. For a SQL Agent job, it might not be using connection pooling, so the distinction between Session and Connection might not be obvious.
Non-committed transactions will be automatically rolled-back if the session is terminated. You can easily test this by: USE tempdb; CREATE TABLE dbo.TestTran ( ID INT NOT NULL CONSTRAINT PK_TestTran PRIMARY KEY CLUSTERED IDENTITY(1,1) ); BEGIN TRAN INSERT INTO dbo.TestTran DEFAULT VALUES; SELECT * FROM dbo.TestTran; Results ...
Top 50 recent answers are included