Your example seems simple, it looks like you are adding only new people without looking for changed data in existing records. In this case, save the last identifier in the database.
CREATE TABLE dbo.LAST (RW int, LastID Int) go INSERT INTO dbo.LAST (RW, LastID) VALUES (1,0)
Now you can use this to insert the last identifier of the passed string.
UPDATE dbo.LAST SET LastID = @myLastID WHERE RW = 1
When choosing an OLEDB source, set the data access mode in SQL Command and use
DECLARE @Last int SET @Last = (SELECT LastID FROM dbo.LAST WHERE RW = 1) SELECT * FROM AlphaPeople WHERE ID > @Last;
Notice, I assume that you are using the ID int IDENTITY for your PC.
If you need to track changes in the data of existing records, then in the "last modified" column in each table and store the time of the last transfer.
A different method would be to configure the linked server from Beta to Alpha and run your example without using SSIS. I expect this to be slower and more resource intensive than SSIS.
INSERT INTO dbo.BetaPeople SELECT * FROM [Alpha].[myDB].[dbo].[AlphaPeople] WHERE ID NOT IN (SELECT ID FROM dbo.BetaPeople)
Damir sudarevic
source share