Solved

Need of using BeginTrans and CommitTrans

Posted on 2000-04-02
2
426 Views
Last Modified: 2012-06-27
Hi.... why cannot I executed a SQL statement without enclosing it by BeginTrans and CommitTrans instructions? what do they really do?

Thanks
Skel
0
Comment
Question by:skel
2 Comments
 

Expert Comment

by:chsoh
ID: 2678774
The main purpose of transaction is make data isolation so that multiple users can access data simultaneously without interfering with one another.

When you execute a SQL begin with BeginTrans, you MUST execute the CommiTrans or RollbackTrans to either make the transaction success or Undo the transaction.

This is becoz when you execute the BeginTrans, all the statements & instruction under BeginTrans will be keeped & recorded before it actually done on database. The statements between BeginTrans and CommitTrans will be actually done after the CommitTrans statement, or cancelled if RollbackTrans.

anythings need to know ?
0
 
LVL 4

Accepted Solution

by:
srikant033100 earned 50 total points
ID: 2679431
Hi
Skel
You actually need a begin Trans to tell to the RDBMS that it is actuall starting a new transaction and it is very important to maintain the consistencies of data. Untill u start with a begin trans or end with an commit or rollback it is very difficult to maintain the database at a consistent and accurte level. That is why every transaction or else a set or action which together we call as transaction has to start with a begin trans and end with end trans or rollback with rollback.

0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Database tuning – How to start and what to tune. This question is frequently asked by many people, both online and offline. There is no hard and fast rule-of-thumb for performance tuning, however, before beginning the tuning process one should a…
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now