![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a requirement to import data from one SQL Server (2005) database, to another, transforming the data on the way through. So, DTS seems to fit that requirement perfectly. My problem is, how to lanch that DTS package. Source database gets populated, and then as soon as possible, we need to start importing from that database. The data in the source is actually pumped in via a 3rd party. They are open to assisting us. I've propsed that they create a 'ExportDetail' type table in the source database. Once their import completes, the write the last ID of the master table table to the ExportDetail table. The master table would be last ID of the top most record. For example, if we have a Customer->Orders->Products heirarchy, then CustomerId would be the ID we're interested in. Once they complete their import, when then grab from the Last ID back towards a locally stored 'FirstId'. Sorry, confusing. We would know the lastId that we last imported. So we would then read Customers from OUR last ID, to their last ID. So, once they complete their import, they INSERT a row into the ExportDetails table with the LastID. Now, there would be a trigger on that table. An INSERT trigger. Could this trigger be used to set off a DTS package? The package could then grab the LastID and store it on our side, and then grab all the rows. Does this seem like a good solution or is there better way to do this? . |
#3
| |||
| |||
|
|
I have a requirement to import data from one SQL Server (2005) database, to another, transforming the data on the way through. So, DTS seems to fit that requirement perfectly. My problem is, how to lanch that DTS package. Source database gets populated, and then as soon as possible, we need to start importing from that database. The data in the source is actually pumped in via a 3rd party. They are open to assisting us. I've propsed that they create a 'ExportDetail' type table in the source database. Once their import completes, the write the last ID of the master table table to the ExportDetail table. The master table would be last ID of the top most record. For example, if we have a Customer->Orders->Products heirarchy, then CustomerId would be the ID we're interested in. Once they complete their import, when then grab from the Last ID back towards a locally stored 'FirstId'. Sorry, confusing. We would know the lastId that we last imported. So we would then read Customers from OUR last ID, to their last ID. So, once they complete their import, they INSERT a row into the ExportDetails table with the LastID. Now, there would be a trigger on that table. An INSERT trigger. Could this trigger be used to set off a DTS package? The package could then grab the LastID and store it on our side, and then grab all the rows. Does this seem like a good solution or is there better way to do this? |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
Thanks very mich guys. Todd, I am looking at that SSSB thing. I have never used it, but I have google. That's for warning me about that issue. So, thetrigger would basically be 'stuck' with the SSIS package fires? Not good. Thanks. My mistake as well - we're using SQL Server 2005, and SSIS. I keep forgetting that the name is different. I have updated my documentation to reflect that. Thanks again. Russell, thanks! My knowledge on the SSSB is limited, and if I battle, your option of EXEC msdb.dbo.sp_start_job might work well. But, does that lock up the trigger until the job completes? Thanks guys. . |
![]() |
| Thread Tools | |
| Display Modes | |
| |