Solved

Need of using BeginTrans and CommitTrans

Posted on 2000-04-02
2
442 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
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…

734 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