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 is mssql?
Why should we go for stored procedures? Why not direct queries?
What is used to replicate sessions between instances in coldfusion clusters?
Explain primary key, foreign key and unique key?
in the physical file layout, where should the transaction log be stored in relation to the data file?
What is the ‘fillfactor’?
how to control the amount of free space in your index pages? : Sql server database administration
my name is sejal I have cleared the sbi clerk exam. I am BCA graduate My favorite subject RDBMS Relational database management system. so please send me rRDBMS related interview questions
Explain DBCC?
What is role playing dimension with two examples? : sql server analysis services, ssas
What is model database? : SQL Server Architecture
Define the one-to-one relationship while designing tables.
What is GUID in sql server?
List out the differences between global and local temp tables in sql server?
What does it mean to normalize data?