Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews New MS SQL Server Interviews:MS SQL Data MiningMS SQL Reporting ServicesMS SQL Server 2008MS SQL Server IndexesMS SQL Server JoinsMS SQL Server OptimizationMS SQL Server ReplicationMS SQL Server ViewsMS SQL Server XML IntegrationSQL Database ConceptsSQL Server ArchitectureSQL Server ConstraintsSQL Server CursorsSQL Server Database AdministratorSQL Server FunctionsSQL Server LocksSQL Server Service BrokerSQL Server TriggersSQL Stored ProceduresSSISTransaction Server
Copyright © 2018. All Rights Reserved
Transaction Server Interview Question:
Do you know nested transaction?
Submitted by: AdministratorA nested transaction is one in which a new transaction is started by an instruction that is already inside another transaction. This new transaction is said to be nested. The isolation property of transaction is obeyed here because the changes made by the nested transaction are not seen or interrupted by the host transaction.
BEGIN TRANSACTION trans_1
INSERT INTO TestTrans1 VALUES (1,'mark')
COMMIT TRANSACTION trans_1;
GO
/* Start a transaction and execute trans_1. */
BEGIN TRANSACTION trans_2;
GO
EXEC trans_1 1, 'aaa'; //execute some procedure
GO
ROLLBACK TRANSACTION trans_2;
GO
EXECUTE TransProc 3,'bbb';
GO
Submitted by: Administrator
BEGIN TRANSACTION trans_1
INSERT INTO TestTrans1 VALUES (1,'mark')
COMMIT TRANSACTION trans_1;
GO
/* Start a transaction and execute trans_1. */
BEGIN TRANSACTION trans_2;
GO
EXEC trans_1 1, 'aaa'; //execute some procedure
GO
ROLLBACK TRANSACTION trans_2;
GO
EXECUTE TransProc 3,'bbb';
GO
Submitted by: Administrator
Copyright 2007-2025 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.