SQL Server Performance

uploading problem

Discussion in 'SQL Server DTS-Related Questions' started by mogaligundla, Feb 24, 2005.

  1. mogaligundla New Member

    Hello everyone,
    I have created several DTS packages that transfer data from one database to another, i am using an ASP form to run these packages from the browser. These packages are run by the user once every 15 days and data is transfered from the source database to the destination database, if the user executes this package more than once, data that was already entered into the database in the first run is entered again creating a whole bunch of duplicate records, how do i eliminate this duplication and let the user know that the package has already been executed.


    thank you in advance
    harsha
  2. mmarovic Active Member

    Load data in auxiliary table, then use execute dts task to insert ... select where not exists(...) or its left join equivalent (faster).
  3. mogaligundla New Member

    Hi,

    i created an auxillary table and am loading data into it, after that how do i insert into the tables that i want to, should i select the execute sql task or the transform data task and where do i put in select where not exists statement?

    regards
    harsha


  4. mmarovic Active Member

    execute sql task, something like:
    insert into targetTable(...)
    select ...
    from sourceTable s
    where not exists(select *
    from targetTable t
    where t.pk = s.pk)
  5. mogaligundla New Member

    thank you mmarovic i really appreciate your help, i will try your code and see how things work out.



    regards
    harsha
  6. azam316 New Member

    Posted - 02/24/2005 : 10:56:56
    --------------------------------------------------------------------------------

    hi mogaligundla,

    i know this will make me sound like a total jerk! but i am DESPERATE!!!
    it would be gr8 and mighty kind of you if you could give me the code for transfering the data from a source database to a destination database.
    please!

    thanx in advance

    <<<<DTA>>>>

Share This Page