Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Constraints/Bug in using VB6 and SQL Server Transaction

Status
Not open for further replies.

nurdinsena

Programmer
Mar 29, 2014
2
0
0
I had the same problem when storing multiple programs with state computer "Transaction Number" together, which is where the Index database that is used is "Transaction Number".

So, in the successful storage of just 1, and the other with "Error Trapping" will repeat the incrase Transaction Number. And in the storage procedure I use TTS (Time Tracking System) with BeginTransaction, CommitTransaction and RollBackTransaction. But there are some times of events, some of the data in storage, eg "Data Details of other computers enter into a transaction that is stored, so also there are some updates stock".

In your opinion as an expert what I need to improve? Thank you
 
Are you using SET XACT_ABORT ON in your code?

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
You should.


When SET XACT_ABORT is ON, if a Transact-SQL statement raises a run-time error, the entire transaction is terminated and rolled back.

When SET XACT_ABORT is OFF, in some cases only the Transact-SQL statement that raised the error is rolled back and the transaction continues processing. Depending upon the severity of the error, the entire transaction may be rolled back even when SET XACT_ABORT is OFF. OFF is the default setting.

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top