dbTalk Databases Forums  

Commit transaction after each updated record

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Commit transaction after each updated record in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Brenda
 
Posts: n/a

Default Commit transaction after each updated record - 06-14-2006 , 01:53 PM






Hi
I have a master table in SQL with its corresponding detail tables (more
than one).
I want to scan the master table and for each record I have to update
other related tables, but when it finishes all the processing of one
record, it should commit a transaction in order not to loose the whole
work because just one record reported errors.
I have sqldts.com article about looping through a recordset but I am
getting confused when I want to add all the transaction logic.
Can anyone help me at least in general how do I start??? I am a little
bit messed up !
Thanks!
Brenda.-


Reply With Quote
  #2  
Old   
rb
 
Posts: n/a

Default RE: Commit transaction after each updated record - 06-15-2006 , 03:17 AM






Hi Brenda,

I am assuming you are using an ADO recordset, if that's the case then you
can use BeginTrans, Rollbacktrans and CommitTrans.

Have a look at:

http://msdn.microsoft.com/library/de...adomethods.asp

Ray

"Brenda" wrote:

Quote:
Hi
I have a master table in SQL with its corresponding detail tables (more
than one).
I want to scan the master table and for each record I have to update
other related tables, but when it finishes all the processing of one
record, it should commit a transaction in order not to loose the whole
work because just one record reported errors.
I have sqldts.com article about looping through a recordset but I am
getting confused when I want to add all the transaction logic.
Can anyone help me at least in general how do I start??? I am a little
bit messed up !
Thanks!
Brenda.-



Reply With Quote
  #3  
Old   
Brenda
 
Posts: n/a

Default Re: Commit transaction after each updated record - 06-16-2006 , 02:06 PM



I asked in case I was taking the more complicated way, maybe there was
another way to achieve the same without managing the transaction via
vbscript.
I am going to use a recordset, stored in a Global Variable and then
iterate through its records, doing some processing related to each
record, and then at the end of this processing I will commit the
transaction... continue with the next and so on.
I am going to use activex tasks, loops and transactions....
Wish me luck, jajjaa.
Thanks a lot.
Brenda.-

rb wrote:
Quote:
Hi Brenda,

I am assuming you are using an ADO recordset, if that's the case then you
can use BeginTrans, Rollbacktrans and CommitTrans.

Have a look at:

http://msdn.microsoft.com/library/de...adomethods.asp

Ray

"Brenda" wrote:

Hi
I have a master table in SQL with its corresponding detail tables (more
than one).
I want to scan the master table and for each record I have to update
other related tables, but when it finishes all the processing of one
record, it should commit a transaction in order not to loose the whole
work because just one record reported errors.
I have sqldts.com article about looping through a recordset but I am
getting confused when I want to add all the transaction logic.
Can anyone help me at least in general how do I start??? I am a little
bit messed up !
Thanks!
Brenda.-




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.