Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 DTS

Author  Topic 

putane.sanjay
Yak Posting Veteran

77 Posts

Posted - 2007-05-25 : 05:34:18
Hi all,

I have csv file which has 2 columns & 4 records are as follows

EmpNo EmpName

1 a
2 b
3 c
1 a

I created new table called T4, structure of T4 is

EmpNo Varchar(50) with Primary Key
EmpName Varchar(50) disabled Allow Nulls

Now I started importing csv data to T4 table, during importing it couldn't
finish entire process. Throwing error, when I remove primary key with
disable Allow Nulls for both constraints of a table T4. Importing data
successfull.
My question is if I have above said structure for the table T4 (with
primary Key), during importing instead of throwing error let it be import
first 3 rows then throw error as primary key enabled could not able to
import. Is this can be possibe, if so please suggest me to solve the
problem.

Thanks in advance
PMS

mwjdavidson
Aged Yak Warrior

735 Posts

Posted - 2007-05-25 : 05:58:48
Just to clarify, are you using DTS or SSIS?

Mark
Go to Top of Page

putane.sanjay
Yak Posting Veteran

77 Posts

Posted - 2007-05-25 : 06:06:38
using dts
Go to Top of Page

mwjdavidson
Aged Yak Warrior

735 Posts

Posted - 2007-05-25 : 07:00:12
With DTS, I'd always advise performing an initial insert into a staging table (without constraints), then testing for duplicates, data type issues, etc. before performing the final insert.

Mark
Go to Top of Page
   

- Advertisement -