It will happen when you have the ID with auto increment. So follow my idea
- Create a view with out the ID field of the table
- Insert the data in the view
for example
CREATE TABLE DIM_Vitals (
QueryType varchar(255) default NULL,
QueryDate varchar(255) default NULL,
APUID varchar(255) default NULL,
VitalID varchar(255) default NULL,
VitalName varchar(255) default NULL,
LoadDate varchar(225) default NULL,
id BIGINT IDENTITY(1,1) NOT NULL,
PRIMARY KEY (id) ,
CONSTRAINT dim_v UNIQUE (VitalID, VitalName)
) ;
create a view for the above table
create view DIM_Vitals_view
as
select
QueryType,
QueryDate,
APUID,
VitalID,
VitalName,
LoadDate
from DIM_Vitals
now insert data into view [ DIM_Vitals_view - view name ]
bcp DIM_Vitals_view IN DIM_Vitals_final.dat -f DIM_Vitals.Fmt -S <ServerIP> -U <User> -P <Pwd> -F2
sure it will solve the problem
make sure your view is not having the id field