x

BCP is throwing error as Invalid character value for cast specification

Hi,

I am New to SQL server. I am trying to load a file from UNIX to SQL Server . When i run the BCP getting the below error but i was able to load the same file when i changed the datatype to Char.

Here is the error -

@ Row 1, Column 7: Invalid character value for cast specification @

11 2018-01-04 N XXX 2018-01-04 XXX 2018-01-04 222 2018-01-04|N|XXX|2018-01-04|XXX|2018-01-04

BCP

bcp [SQLAAA].[APP_XXX].[ACTIVITY_V1] in /home/XXX_ACTIVITY.txt -c -S xddb001 -e /home/ERRORS.log -t "|" -r "\n" -E -U test12 -P test12

DDL

CREATE TABLE [APP_XX].[ACTIVITY]

( [C1] [varchar](10) NOT NULL, [C2_DATE] [date] NOT NULL, [c3] [varchar](1) NULL, [C4_NM] [varchar](10) NULL, [C5_DTM] [date] NULL, [C6_NM] [varchar](10) NULL, [C7_DTM] [date] NULL, [ROW_ID] [bigint] IDENTITY(1,1) NOT NULL ) ON [PRIMARY]

Could you please let me know what modification can be done.

Regards Vedamurthy

more ▼

asked Jan 11 at 11:41 AM in Default

avatar image

Vedamurthy
1

(comments are locked)
10|1200 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x56

asked: Jan 11 at 11:41 AM

Seen: 30 times

Last Updated: Jan 11 at 11:41 AM

Copyright 2018 Redgate Software. Privacy Policy