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
What are the ways available in sql server to execute sql statements?
What stored by the msdb?
How to verify a login name with sqlcmd tool?
Can we write a distributed query and get some data which is located on other server and oracle database?
Difference between Sql server reporting services and Crystal reports?
How you can move data or databases between servers and databases in sql server?
Define right outer join?
How and why use sql server?
Explain foreign key in sql server?
How to get the number of affected rows?
How to find which stored procedure is currently running in sql server?
Does the unique constraint create an index?
how would you improve etl (extract, transform, load) throughput?
What are the advantages of using a stored procedure?
How can a user-defined datatype be created?