Showing posts with label rollback. Show all posts
Showing posts with label rollback. Show all posts

Monday, March 19, 2012

Is SqlTransaction overhead ?

hi,

Is it over head to use SqlTransaction(begin, commit, rollback) for a single transaction.

am not using application block or enterprise library.

only a single insert statement.

Yes, SQL Transactions are an overhead to SQL Server whether you are writing a single query or a batch of queries, but on the other side you are rest assured that in case of any errors you can always rollback the transaction and on successful execution only you will commit transaction.

Have a look at Trasactions in SQL BOL.

Hope this will help.

|||

hi

i dont think that using the sqlTransaction causes any overhead ...

regards,

Wednesday, March 7, 2012

is rollback possible here?

hi friends,

is it possible to roll back a transaction here? i heard that it will be possible only if we wrote the code only in certain block.please tell me the block.

vinodcan you post the sample query

Roll back can happen
1. if you put your statements inside a 'BEGIN TRAN ...ROLLBACK TRAN ' statements

2. if you stop the running Query before it completes