Solved

Skipping duplicate records while DTS transformation using VB

Posted on 2003-11-03
5
426 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

690 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