Receiving data type error upon attempting to load a text file into Sql Server 2008R2 table.
Specifically, the error message received is similar to the following;
To attempt to resolve,
Step 1: I verified that the data type for the column "DAILY_VALUE" is numeric - I specified as "numeric(18,0)" .
Step 2: Reviewed the actual code that is used to bulk insert - It looks okay.
BULK INSERT dbo.Accounts
FROM 'C:\Data\Accounts.txt'
WITH ( FIELDTERMINATOR ='\t', FIRSTROW = 1 )
Step 3: Reviewed the actual text file using MS Excel and determined that it appears that all of the data type conversion
errors occur on records where the value in the column titled "DAILY_VALUE" is "0." My thought is that the numeric data type should handle values of "0".
Does anyone know how I can resolve the data type conversion errors? Thanks in advance!
Specifically, the error message received is similar to the following;
Code:
Msg 4864, Level 16, State 1, Line 1
Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 6600, column 30 (DAILY_VALUE).
.
.
.
To attempt to resolve,
Step 1: I verified that the data type for the column "DAILY_VALUE" is numeric - I specified as "numeric(18,0)" .
Step 2: Reviewed the actual code that is used to bulk insert - It looks okay.
BULK INSERT dbo.Accounts
FROM 'C:\Data\Accounts.txt'
WITH ( FIELDTERMINATOR ='\t', FIRSTROW = 1 )
Step 3: Reviewed the actual text file using MS Excel and determined that it appears that all of the data type conversion
errors occur on records where the value in the column titled "DAILY_VALUE" is "0." My thought is that the numeric data type should handle values of "0".
Does anyone know how I can resolve the data type conversion errors? Thanks in advance!