Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15889

Change Tracking for table which is daily refreshed

$
0
0

We have a table which is refreshed everyday by the following process

  1. Download text file from Remote server
  2. Truncate existing table
  3. Insert data from text file to the table

Here is the sample structure for our table

CREATE TABLE dbo.mytable
  (
     cola NVARCHAR(10) NULL,
     colb NVARCHAR(10) NULL
  )
ON [PRIMARY]
go  

INSERT INTO dbo.mytable
VALUES     ('R1', '100')  

INSERT INTO dbo.mytable
VALUES     ('R2', '150')  


The records rarely changes everyday and therefore we usually get the text file with exactly the same records. As the changes of the table may be critical, we would like to monitor the changes on table records. For example, we need to know if the colB of R2 changes from '150' to '200' on 12-12-2012

We understand that there is option for change tracking in table setup. However, we are not sure whether truncate table in Step2 clears all our changes and system assumes all records are new. If the change tracking option cannot help us, we need to create an application and table that monitor the changes.

Thank you for help



Viewing all articles
Browse latest Browse all 15889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>