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?
Answer Posted / 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 View All Answers
Suppose you want to implement the one-to-one relationships while designing tables. How would you do it?
What is database replication? What are the different types of replication you can set up in sql server?
Can you please explain the difference between function and stored procedure?
Can two tables have the same primary key?
How to access the inserted record of an event?
When would you use the stored procedures or functions?
Explain differences between web edition and business edition?
Tell me what do you understand by a view? What does the with check option clause for a view do?
Explain the various types of concurrency problem?
Why use “nolock” in sql server?
What is merge join?
What is cdc in sql server?
What is 1nf normalization form?
What is Service Broker in sql server 2012?
How you can minimize the deadlock situation?