sql server - Bulk load data conversion error while importing DATETIME data -
i found few posts on topic on stackoverflow, none seem solve problem.
i trying set bulk imports sql server 2008 express, , failing import datetime values. issue seems basic must missing simple, , i'm hoping else can catch problem.
the problem
i importing table:
create table [dbo].[bulktest]( [reportdate] [datetime] not null ) this format file (bulktest.fmt):
10.0 1 1 sqldatetime 0 0 "\r\n" 1 reportdate "" this data being imported (bulktest.tab):
reportdate 2010-12-31 2011-01-31 this import statement:
bulk insert dbo.bulktest 'q:\...\bulktest.tab' ( check_constraints, tablock, formatfile='q:\...\bulktest.fmt', firstrow=1, datafiletype='char' ); these errors:
bulk load data conversion error (type mismatch or invalid character specified codepage) row 1, column 1 (reportdate). msg 4864, level 16, state 1, line 1 bulk load data conversion error (type mismatch or invalid character specified codepage) row 2, column 1 (reportdate). msg 4832, level 16, state 1, line 1 i have tried
- changing date format, including
12/31/2010,31/12/2010,20101231,2010-12-31 00:00:00, , various other formats. - adding/removing/changing bulk insert statement options
datafiletype,tablock,check_constraints. - changing delimiter , field size in format file (though per msdn field size should not matter).
- running
set dateformat ymd. - checking imported file hex editor make sure contain 8-bit chars , not unicode; contains shown in ascii format.
any ideas?
this format works in code:
08/17/2000 16:32:32 the producer happens .net, tostring(datetimeformatinfo.invariantinfo).
Comments
Post a Comment