![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I have a question: I have a DTS package with two tasks: 1. A Copy SQL Server Object Task: to copy a table object between two database servers 2. A Execute SQL Task: to delete all rows in the table previously copied This is a database used by a web application, and there might be inserts into the table between these two steps. How can I garantee that the rows that are deleted in step 2 are only those copied in step 1, and none that are newly inserted? I've have read about the transaction isolation level that I can define in the DTS package, namely about "Repeatable Read. You are guaranteed not to see any changes made by other transactions in values it has already read." Does this work in my case? Thanks for your help Rafaela |
#3
| |||
| |||
|
|
The problem here being that the transfer is one transaction and the delete another. You could Pump the records over (You do not need to recreate the table everytime surely) You could then have a linked server back to the source that says delete from source where the record PK = ones I just copied over. -- ---------------------------- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "RKAzinhal" <rafaelaka (AT) hotmail (DOT) com> wrote in message news:#jgasqHTDHA.3636 (AT) tk2msftngp13 (DOT) phx.gbl... Hi, I have a question: I have a DTS package with two tasks: 1. A Copy SQL Server Object Task: to copy a table object between two database servers 2. A Execute SQL Task: to delete all rows in the table previously copied This is a database used by a web application, and there might be inserts into the table between these two steps. How can I garantee that the rows that are deleted in step 2 are only those copied in step 1, and none that are newly inserted? I've have read about the transaction isolation level that I can define in the DTS package, namely about "Repeatable Read. You are guaranteed not to see any changes made by other transactions in values it has already read." Does this work in my case? Thanks for your help Rafaela |
#4
| |||
| |||
|
|
The problem is, the table has no PK, because it's a log table... Are there other suggestions? Thanks, Rafaela "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message news:e$koK3JTDHA.2252 (AT) TK2MSFTNGP12 (DOT) phx.gbl... The problem here being that the transfer is one transaction and the delete another. You could Pump the records over (You do not need to recreate the table everytime surely) You could then have a linked server back to the source that says delete from source where the record PK = ones I just copied over. -- ---------------------------- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "RKAzinhal" <rafaelaka (AT) hotmail (DOT) com> wrote in message news:#jgasqHTDHA.3636 (AT) tk2msftngp13 (DOT) phx.gbl... Hi, I have a question: I have a DTS package with two tasks: 1. A Copy SQL Server Object Task: to copy a table object between two database servers 2. A Execute SQL Task: to delete all rows in the table previously copied This is a database used by a web application, and there might be inserts into the table between these two steps. How can I garantee that the rows that are deleted in step 2 are only those copied in step 1, and none that are newly inserted? I've have read about the transaction isolation level that I can define in the DTS package, namely about "Repeatable Read. You are guaranteed not to see any changes made by other transactions in values it has already read." Does this work in my case? Thanks for your help Rafaela |
![]() |
| Thread Tools | |
| Display Modes | |
| |