Solved

Skipping duplicate records while DTS transformation using VB

Posted on 2003-11-03
5
420 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

863 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

27 Experts available now in Live!

Get 1:1 Help Now