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
Insert syudents details in table.Current system date &time insert into joining time.How do insert?( in sysdate only return current system date how do add time?)
Mention the differences between sql server and mysql.
How to throw custom exception in Stored Procedure?
What is dirty page?
Explain how to use linked server?
How many types of stored procedures are there in sql server?
What is sleeping status in sql server?
How can windows applications connect to sql servers via odbc?
Define Unique Key?
How to write an inner join with the where clause in ms sql server?
Is the log file is a part of file group?
Write a program using SQL queries to find a unique entry in a table.
What is sparse columns of sql server 2008?
Is it safe to delete log files?
What is SQL Azure Data sync?