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

How do you delete a trigger?

0 Answers  


What is Report Server,Report Manager and Report Builder in SSRS 2005?

1 Answers  


In performance wise distinct is good or group by is good? eg:select name from emp group by name; select distinct name from emp;

5 Answers   Infosys,


What is the template in sql?

0 Answers  


What are the instances when triggers are appropriate?

0 Answers  






any one can explain Self mapping Delegation Remote Credentials

1 Answers  


What are the properties of the transactions?

0 Answers  


John exports information periodically from a microsoft sql server database to an oracle database what is the best way to do this?

0 Answers  


What are the different types of indexes?

0 Answers   Blue Star,


What is an extended stored procedure? Can you instantiate a COM object by using T-SQL?

1 Answers  


How to loop through result set objects using mssql_fetch_array()?

0 Answers  


mention different types of relationships in the dbms?

0 Answers  


Categories