![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Give flag field at all Production tables |
#2
| |||
| |||
|
|
My current project now is how to synchronize (data transfer) between Production Database & Reporting Database using DTS, but I have no idea how to do it and using which the best method. Need to know, that two database have different structure tables - of course - and have a thousand records inside, and our transaction working 24 hours, so that's imposible to delete all records at Reporting Database and replace with new data. The method that I've considered now is : Give flag field at all Production tables - 0 : haven't transfered at all - 1 : the record have been modified - 2 : have transfered to Reporting database So I only need delete all records at Reporting Services which match record at Production have flag 1, and then transfered all records that have flag 0 and 1. But the weakness of my method is how to synchronize for deleted records? Should I save the primary key of deleted records, or is there any other method? Please give me suggestion/comment for my method. Thanks |
#3
| |||
| |||
|
#4
| |||
| |||
|
#5
| |||
| |||
|
|
Your suggestion is more good than my idea. But there's some difficult when I try to implement it in DTS. I prepare a table to save LogTime, with structure : DTSLog ( DTSName, StartTime, Duration EndTime AS (dateadd(hour,[duration],[starttime]) ) The problem is : 1. I've passing DTSLog contain to Global Variables with type Rowset But how to use it as Output Parameter in Execute SQL Task, for example to this query : DELETE dbReport..DeliveryNotes FROM dbReport..DeliveryNotes D1, ServerA.db2.dbo.DeliveryNotes D2 WHERE D1.ReceivingID=D2.ReceivingID AND dtModified BETWEEN ? AND ? I get an error : Syntax error or access violation 2. I hear that parameter cannot used in query that have subquery. Is that true. Please give some clue Thanks |
![]() |
| Thread Tools | |
| Display Modes | |
| |