Solved

Need of using BeginTrans and CommitTrans

Posted on 2000-04-02
2
445 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

705 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