Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 16, 2012 03:34 PM by inquisitive_mind
Member
326 Points
131 Posts
Aug 16, 2012 10:45 AM|LINK
Hi guys,
I am using sqlbulkcopy to insert thousond of record from xls to DB.
The problem is how i do avoid duplicates values??
for this i dont want to use extra table or any other trigger or identity column...
is ther any other way to do this????
Contributor
3421 Points
575 Posts
Aug 16, 2012 03:34 PM|LINK
Use the "not exists" clause of the select statement in your insert statement to the table.
Take a look at this link it has examples of how to use insert and not exists
http://www.techonthenet.com/sql/insert.php
dineshchaudh...
Member
326 Points
131 Posts
Duplicate issue using Sqlbulkcopy..please help
Aug 16, 2012 10:45 AM|LINK
Hi guys,
I am using sqlbulkcopy to insert thousond of record from xls to DB.
The problem is how i do avoid duplicates values??
for this i dont want to use extra table or any other trigger or identity column...
is ther any other way to do this????
Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread.
inquisitive_...
Contributor
3421 Points
575 Posts
Re: Duplicate issue using Sqlbulkcopy..please help
Aug 16, 2012 03:34 PM|LINK
Use the "not exists" clause of the select statement in your insert statement to the table.
Take a look at this link it has examples of how to use insert and not exists
http://www.techonthenet.com/sql/insert.php
while(1)