Articles → SQL SERVER → Autocommit transactions in SQL server

Autocommit transactions in SQL server






What are auto-commit transactions?







Enable auto-commit mode




SET IMPLICIT_TRANSACTIONS OFF



Prerequisite





Click to Enlarge




Case 1: when T-SQL statement contains compile time error




Set identity_insert TestTable On 

Insert into [dbo].[TestTable] values(1,'Test1')
Insert into [dbo].[TestTable] va1lues(1,'Test2')

Set identity_insert TestTable Off







Case 2: Invalid object name (or other run time error)




Set identity_insert TestTable On 

Insert into [dbo].[TestTable] (Id, Name) values(1,'Test1')
Insert into [dbo].[TestTable1] values(2,'Test2')

Set identity_insert TestTable Off







Click to Enlarge

Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, October 10, 2017

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250