April 5, 2009 at 4:39 pm
I have a table where the schema is as follows
id bigtin identity(1,1)
sn varchar(50)
create primary key pk_id on table(id)
create unique index ui_sn on table(sn)
now if i use the import/export wizord, i would like to import a text file, but if there is a duplicate, i would like it to ignore it and keep going, In the import wizord, there is even a drop down to continue on error. But it always seems to stop as soon as it finds a duplicate.
I rather not have to import the text file into a temp table, and then to a insert statment with a left outer join on itself and saying where table2.sn is null (one time i even ran this and it still says there was a duplicate!!! which is freaking impossible!!!) there were no other inserts going on to the table at the time!
just to clear up my sql statment was
insert into table1 t1 (select t2 from table2 left outer joing table1 t1 on t1.sn = t2.sn where t1 is null)
did i do the statment wrong? i mean i ran this before successfully with no problems
Im sorry for the cross post , i found out later this might be more relevant in this forum
April 5, 2009 at 5:26 pm
duplicate post.(actually triplicate!)
no need to cross post to multiple forums it fractures the answers you get and makes posters duplicate others work.
the "Recent Posts" link shows us everything.
continue the thread here:
http://www.sqlservercentral.com/Forums/Topic690671-338-1.aspx
Lowell
April 5, 2009 at 8:46 pm
Closed
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply