The following is my store proc. I use Bulk Insert to copy files from .txt to my table. Table primary key is tracking_number.
I need to ignore duplicates and move to next record. Is this possible to do this with Bulk Insert. Right now I am getting the following error:
Violation of PRIMARY KEY constraint 'PK_daily_shipments'. Cannot insert duplicate key in object 'dbo.daily_shipments'.
SET NOCOUNT ON;
INSERT [dbo].[daily_shipments] from 'D:\OUT\out.txt'
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'