If i have one transaction say mainTransaction, within this
mainTransaction i have another two transaction say t1 and t2.
Now while execution t1 completes successfully and commit
statement fires, but while executing t2 some error occurs
and rollback statement fires.
What happen to t1, is it rollback or not?



If i have one transaction say mainTransaction, within this mainTransaction i have another two trans..

Answer / candorz

BEGIN TRANSACTION
GO
BEGIN TRANSACTION
INSERT INTO [JSSKDB].[dbo].[JobsDb_Countries]
([CountryName])
VALUES
('something')
GO
COMMIT
GO
BEGIN TRANSACTION
INSERT INTO [JSSKDB].[dbo].[JobsDb_Countries]
([CountryName])
VALUES
('something1')
ROLLBACK
GO


For the above transaction the rollback will undo any changes made by the previous sub-transaction i.e. no change will be seen in the DB

Is This Answer Correct ?    7 Yes 1 No

Post New Answer

More SQL Server Interview Questions

is there a column to which a default can't be bound? : Sql server database administration

0 Answers  


What is full outer join in sql server joins?

0 Answers  


What are the types of lock supported by ?

0 Answers   HCL,


How to find Duplicate Records In table?

0 Answers   HCL,


how to write test cases for testing databases,especially for testing and writing test cases for stored procedures.any real time database testers.please answer me.

0 Answers  






How do you find the number of rows in a table?

7 Answers  


How to transfer an existing table from one schema to another schema in ms sql server?

0 Answers  


UPDATE statement can on a single table or on the multiple table?

7 Answers   iGate, TCS,


What is normalization and its types?

0 Answers  


What is the use of stored procedure?

0 Answers  


what purpose does OPENXML clause have in sql server stored procedure?

1 Answers  


Can we use where and having clause together?

0 Answers  


Categories