Home Forums SQL Server 2008 T-SQL (SS2K8) Most efficient way to extract data for a historical data table RE: Most efficient way to extract data for a historical data table

  • Does the table(s) in question have a surrogate key (i.e. identity column or something)? If so use your date query but add a statement to get anything that is greater than the highest value in your history table.

    If you have to worry about updates to existing data maybe use a two step approach where you update the current records based on the PK and verify that something has changed (using binary_checksum() or something like it). Then do your inserts based on new data.

    Would something like that work? or did I miss something in your post?



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]