Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2003
    Posts
    14

    Unanswered: Import only yhe changed data

    I want to import via DTS to big table only the records that changed last day. can i do it without a time field? because this is a key table for DWH and not a fact table.
    THX
    Inon

  2. #2
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    It would be bit difficult to import without a time field, which is key to compile the data.

    If your task is about changed data then why not consider replication.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Sure, but you need a staging environment...

    1. bcp (I can't abvide DTS unless the data is in Excel or Access, even then....) in to a stage table
    2. Write 3 sql statements to compare new data with old...determine, based on keys, which data was added, which data was deleted, and which data was updated..

    3. Then INSERT, DELETE and UPDATE those sets of data...

    Got a link somewhere....

    Hold on....
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  4. #4
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    You can use the BINARY_CHECKSUM function to determine whether data was changed.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •