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

Where are sql server usernames and passwords stored in the sql server?

0 Answers  


What is a trigger?

4 Answers  


About DTS usage ?

2 Answers   Cognizant, Wipro,


What do you understand by a view? What does the with check option clause for a view do?

0 Answers  


What are different types of table joins?

0 Answers  






How to rebuild indexes with alter index ... Rebuild?

0 Answers  


What are the differences between “row_number()”, “rank()” and “dense_rank()”?

0 Answers  


Is it possible for a stored procedure to call itself or recursive stored procedure?

0 Answers  


What are a scheduled jobs or what is a scheduled tasks?

0 Answers  


Explain the working of sql privileges?

0 Answers  


my problem is tempdb tempdb(dbname) 77752.95 MB(db size) 25345.03 MB (unallocated size) suppose i increased temp db size 10 gb . after increase the temp db showing 87 gb (dbsize) 25346.03MB(unallocated size)--unallocated size is showing same .please clarify.

1 Answers  


What is the maximum number of instances in 32 bit and 64 bit sql server 2012?

0 Answers  


Categories