I'm trying to bulk insert data into a table using the following script and I get a Primary Key Constraint Error... something like " violation of primary key constraint cannot insert duplicate values". I can get around this by truncating the table and running the bulk insert again but the issue with doing that is I loose all the previous data. All I'm trying to do is get a script that will allow me to bulk insert data into my table without getting the above error. The purpose of the bulk insert is to replace pricing in a table with new pricing that changes monthly. Currently I have to do it manually from the software that writes to the sql tables. Please help!!!
BULK
insert dbo.test
FROM 'c:\test.csv'
WITH
(
KEEPIDENTITY,
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO


