sql server - BCP Invalid character value for cast specification -
trying bcp stackoverflow [users] table 1 sql server , hit error
"invalid character value cast specification" small amount of records. specifically, 4 records out of 5 million+ hit error.
exp error msg = row 1176293, column 3: invalid character value cast specification
question is,
why these 4 records hit error? makes them different rest?
to re-create error, create [users] table in sql server.
create table [dbo].[users]( [id] [int] not null, [aboutme] [nvarchar](max) null, [age] [int] null, [creationdate] [datetime] not null, [displayname] [nvarchar](40) not null, [downvotes] [int] not null, [emailhash] [nvarchar](40) null, [lastaccessdate] [datetime] not null, [location] [nvarchar](100) null, [reputation] [int] not null, [upvotes] [int] not null, [views] [int] not null, [websiteurl] [nvarchar](200) null, [accountid] [int] null)
bcp file [users] table load fine, represent 5+ million records loads without error. https://1drv.ms/t/s!atylcajdsq_qgbbpgis-fk6akyxpgw
bcp users in c:\files\users_ok.txt -s localhost -t -d -q -c -e c:\files\userserror_ok.txt
now, bcp file records causes error. https://1drv.ms/t/s!atylcajdsq_qgbboetwz09ayiieevw
bcp users in c:\files\users_not.txt -s localhost -t -d -q -c -e c:\files\userserror_not.txt
what particularly wrong these 4 records?
hint, when use bcp -n native format, loads perfectly. thanks!
Comments
Post a Comment