Can you have a nested transaction?

Answers were Sorted based on User's Feedback



Can you have a nested transaction?..

Answer / brahma

Yes,
Begin transaction t1
update <Table_Name> set <col1>=<col1>+50
Begin Transaction t2
delete from <Table_Name> set <col1>=<col1>+100
commit Transaction t2
end transaction t1

Is This Answer Correct ?    3 Yes 0 No

Can you have a nested transaction?..

Answer / visala

yes, we can have nested transactions. to know the nest
level use @@trancount

Is This Answer Correct ?    3 Yes 1 No

Can you have a nested transaction?..

Answer / swapna

Yes, very much. Check out BEGIN TRAN, COMMIT, ROLLBACK,
SAVE TRAN and @@TRANCOUNT.

Is This Answer Correct ?    1 Yes 1 No

Can you have a nested transaction?..

Answer / ram&saran

It's possible, up to 32 levels of transaction in sql server2005.
begin tran t1
----statements
begin tran t2
----statments
.
.
commit tran t2
commit tran t1

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More SQL Server Interview Questions

When we should use and scope of @@identity?

0 Answers  


Hi All, I want to display all duplicate records in the table. My query has to fetch all the records which are duplicate(First Name or Last Name). Also I want the ability to also pull names where there might be a middle initial placed in the end of the first name field, (i.e., "Maria Z. " vs. "Maria") as well. Please guide me to find this. Table: ID FirstName LastName 1 Zach H Hoffman 2 Zach Hoffman 3 Troy Hoffman 4 Shawn Livermore 5 Prem S 6 Jony Hoffman H 7 Zach Modan I need the query to filter......... ID FirstName LastName 1 Zach H Hoffman 2 Zach Hoffman 3 Troy Hoffman 6 Jony Hoffman H 7 Zach Modan I hope this example will give you clear idea..... Thanks in Advance Prem

2 Answers  


 Explain what is sql override for a source taLle in a mapping?

0 Answers   Informatica,


How can i give the restrictions for the data entry, if i wish to enter only I ,II, III, IV in the grade actegory of student table?

3 Answers  


Can group functions be mixed with non-group selection fields in ms sql server?

0 Answers  






Please get the 4 th maximum salary from a table without using any sql keyword (TOP,MAX are mot allowed)

8 Answers  


what is a schema in sql server 2005? : Sql server database administration

0 Answers  


Explain error handling in ssis?

0 Answers  


How to write a query with an inner join in ms sql server?

0 Answers  


Explain the characteristics of a transaction server for example atomicity, consistency, isolation, durability?

0 Answers  


How to get last system shutdown time in Sql server when restarted system?

1 Answers  


What is a unique index?

0 Answers  


Categories