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 / 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 |
What is use of @@ spid in sql server?
What are cursors? Explain different types of cursors. What are the disadvantages of cursors? How can you avoid cursors?
Explain the difference between control flow and data flow?
What is data modification?
How to get last system shutdown time in Sql server when restarted system?
How to perform backup for certificates in sql server? : sql server security
What is best institute to Learn DotNET And SQL in chennai?
What is sql collation?
What is log shipping? Can we do logshipping with SQL Server 7.0 ?
What are indexes? When do you need to create Indexes?
4 Answers CarrizalSoft Technologies, HP,
What is a constant or literal in ms sql server?
How make remote connection in database?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)