Re: bcp has primary key contraint error
From: John Bell (jbellnewsposts_at_hotmail.com)
Date: 06/08/04
- Next message: Aaron [SQL Server MVP]: "Re: Why <Long Text> in decimal field?"
- Previous message: Mike C.: "Re: Why <Long Text> in decimal field?"
- In reply to: erika: "bcp has primary key contraint error"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 8 Jun 2004 18:33:51 +0100
Hi
Try the -e option. From Books online:
-e err_file
Specifies the full path of an error file used to store any rows bcp is
unable to transfer from the file to the database. Error messages from bcp go
to the user's workstation. If this option is not used, an error file is not
created.
John
"erika" <anonymous@discussions.microsoft.com> wrote in message
news:9888AE94-88DC-499B-8EA9-E61C2A72F546@microsoft.com...
> When running a bcp to insert data into a table, I get a violation of
primary key contraint. Is there any way to tell what row is causing the
problem? The error I'm getting is:
>
> SQLState = 23000, NativeError = 2627
> Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Violation of
PRIMARY KEY constraint 'table_name'. Cannot insert duplicate key in object
'table_name'.
> SQLState = 01000, NativeError = 3621
> Warning = [Microsoft][ODBC SQL Server Driver][SQL Server]The statement has
been terminated.
>
> BCP copy in failed
>
- Next message: Aaron [SQL Server MVP]: "Re: Why <Long Text> in decimal field?"
- Previous message: Mike C.: "Re: Why <Long Text> in decimal field?"
- In reply to: erika: "bcp has primary key contraint error"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|