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's the difference between a primary key and a unique key? : Sql server database administration
How do indexes help, types?
How to start and end transact-sql statements?
If you're given a raw data table, how would perform etl (extract, transform, load) with sql to obtain the data in a desired format?
Explain sql server authentication modes?
What do you understand by a stored procedure?
Can you give me some DBCC command options?(Database consistency check) - DBCC CHECKDB - Ensures that tables in the db and the indexes are correctly linked.and DBCC CHECKALLOC - To check that all pages in a db are correctly allocated. DBCC SQLPERF - It gives report on current usage of transaction log in percentage. DBCC CHECKFILEGROUP - Checks all tables file group for any damage.
What is dirty page?
How many ways to create table-valued functions?
Can we use having clause without group by?
Do you know what is similarity and difference between truncate and delete in sql?
What is difference between temp table and cte?
What are the types of indexing?
What are subquery and its properties?
When I run the sql server 2000 setup, it just hangs. What do I do?