sql server - What are the best practices for detecting changed rows for a data feed? -


i researching best practices managing weekly data feed 3rd party olap service. analysis database initialized full data dump. subsequent weekly feeds provide new , updated rows. data sourced sql server 2005 database.

what preferred approaches detecting new , updated rows?

  1. trigger modified date field on inserts , updates , grab greater last feed extraction; or

  2. timestamp column on source tables , grab rows timestamp greater last feed extraction; or

  3. some excellent idea have not thought of...

well depends on how define changed row.

number 2 works change @ row change timestamp update doesn't change (say updating value 1 1). sounds silly that? it's easy when use dynamic code.

number 1 can modified ensure there differnce between inserted , deleted tables in trigger , fixes problem of option 2.

however, suppose have 3 different feeds each contain different columns might in related tables , want send if 1 of changes. trigger isn't specific enough feeds. use change data tracking identity rows have changed since last send date (which store part of our ssis pacakges) , calculate rowhash data specific columns see if data interested in changed. i've seen people use history table of sent , compare values (if interested in 1 or 2 fields in table) ones changed in change data tracking table. when have requirement specific, end quite complex system support (i'm giving rough idea).


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -