lord.fist (lord.fist@spam.email.htnet.hr) writes:
> I am trying to do bulk insert 5000 rows into a simple table that has:
>
> id pk identity, col_text nvarchar(500)
>
> How do i do bulk insert but to only insert data that is not duplicated
> eg. if i have already in table 'some_text' and bulk inserting
> 'some_text' that the text is not inserted and all other is?
If you are on SQL 2005 you can use OPENROWSET(BULK) and then apply filters
to the data.
Else you will have to do as Alex said, and go by a staging table. If you
are only importing 5000 rows every five minutes, I would not worry about
the load.
--
Erland Sommarskog, SQL Server MVP, esquel.RemoveThis@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx >> Stay informed about: BULK insert