SQL Server Transact-SQL Transactions

If you have created a complex transaction that includes several parts, one part of which has a higher probability of rolling back the transaction than the others, better performance will be provided if you locate the most likely to fail part of the transaction at the front of the greater transaction. This way, if this more-likely-to-fail transaction has to roll back because of a failure, there has been no resources wasted on the other less-likely-to-fail transactions. [6.5, 7.0, 2000, 2005] Added 7-2-2003 

*****

Generally, you only want to encapsulate your Transact-SQL code inside a transaction if it is going to modify the database. Transactions help to ensure database consistency and are an important tool in the developer’s toolbox.

But if you put non-database modifying Transact-SQL in a transaction, you are producing unnecessary overhead for your application and SQL Server. For example, Transact-SQL used for creating reports doesn’t usually need the benefits (and the extra overhead) associated with transactions. [6.5, 7.0, 2000, 2005] Updated 10-30-2003




Related Articles :

  • No Related Articles Found

No comments yet... Be the first to leave a reply!

Software Reviews | Book Reviews | FAQs | Tips | Articles | Performance Tuning | Audit | BI | Clustering | Developer | Reporting | DBA | ASP.NET Ado | Views tips | | Developer FAQs | Replication Tips | OS Tips | Misc Tips | Index Tuning Tips | Hints Tips | High Availability Tips | Hardware Tips | ETL Tips | Components Tips | Configuration Tips | App Dev Tips | OLAP Tips | Admin Tips | Software Reviews | Error | Clustering FAQs | Performance Tuning FAQs | DBA FAQs |