Solved

Skipping duplicate records while DTS transformation using VB

Posted on 2003-11-03
5
418 Views
Last Modified: 2008-03-17
I want to Import several delimited text files into SQL Server using DTS. If i am not using any Index on the table, my program work fine but if i use primary index, on the very first violation of the index DTS Rollbacks all the imported data and thus in effect importing no data at all.

How can i eliminate this?

I want to import million records at a time that may contain duplicate records too and i want to skip duplicate records while importing records in one go.

I don't want to use temporary tables in this process.
0
Comment
Question by:agarwalyogi
5 Comments
 

Expert Comment

by:charlotte1
ID: 9671076
You can loop and import the records one by one.  Each time before you import your row, you can check if the primary key already exists, if it does then you can just loop to the next one, if not, import it.
0
 
LVL 3

Accepted Solution

by:
SQLMaster earned 200 total points
ID: 9671099
Hi agarwalyogi,

You can combine your several delimited files into one single delimited file and then use SQL query in DTS wizard to eliminate duplicate records from your delimited file and then export to SQL server.

Cheers!

Dheeraj

0
 
LVL 34

Expert Comment

by:arbert
ID: 9672326
So what if the primary key is the same but there are differences in the rest of the records?

You can also set your "max error count" to be 9999 and it will consider it a "warning" and not abort....
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now