July 16, 2008 at 10:54 am
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
__________________
July 16, 2008 at 11:00 am
Create a staging table that has the columns, but no constraints/indexes on it. Then clean up the data (remove the duplicate) and insert...select into the table with the constraints.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply