B
B
Boris the Animal2016-03-16 18:05:59
Database
Boris the Animal, 2016-03-16 18:05:59

How can you make such a scenario: fetching data into the archive, if successful, mark that the data has been sent?

4fff4006e844484986f61eb977401b46.jpg5eb69c67b68a43218b000009aff0c891.jpg
There is a database data source, and there is a table in it:

CREATE TABLE dbo.Data (
  ItemId INT IDENTITY,
  Value NVARCHAR(50) NOT NULL,
  CreationDtStamp DATETIME2 NOT NULL CONSTRAINT DefaultDtStamp DEFAULT (GETDATE()),
  Replicated BIT NULL CONSTRAINT DefaultReplicated DEFAULT (0),
  CONSTRAINT PK_Data PRIMARY KEY CLUSTERED (Itemid)
) ON [PRIMARY]
GO

INSERT INTO Data (Value)
  VALUES
   ('sssss'),
   ('3333'),
   ('44444'),
   ('55555'),
   ('667u77'),
   ('hhhhhhh'),
   ('8888888'),
   ('ss99999sss');

There is a DB archive:
CREATE TABLE dbo.Data (
  Itemid INT,
  Value NVARCHAR(50) NOT NULL,
  CreationDtStamp DATETIME2 NOT NULL,
  ReplicationDtStamp DATETIME2 NOT NULL CONSTRAINT DefaultReplicationDtStamp DEFAULT GETDATE(),
  CONSTRAINT PK_Data PRIMARY KEY CLUSTERED (Itemid),
  
) ON [PRIMARY]
GO

From the source I get the data like this:
SELECT TOP (3) 
  ItemId,
  Value,
  CreationDtStamp
FROM Data WHERE Replicated = 0;

Next, the "Lookup Query" checks that such data is not in the database, if not, it saves it. How to do so. that if the data is successfully stored, then mark it in the source table, Replicated. What component to use? How is this generally done in SSIS?
Maybe you know books where everything is well explained? In general, it is not always intuitively clear how to work with all these components in general.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question