Error importing data from CSV with OpenRowset in SQL Server - Mysterious value of "S7" -


i have file dump needs imported sql server on daily basis, have created scheduled task without attendant. csv files decimated ',' , it's windows cr/lf file encoded utf-8.

to import data these csv files, use openrowset. works until ran file in there's value of "s7". if file contains value of "s7" column recognized datatype of numeric while doing openrowset import , lead failure other alphabetic characters imported, leaving null values.

this far had tried:

  1. using imex=1: openrowset('microsoft.ace.oledb.15.0','text;imex=1;hdr=yes;
  2. using text driver: openrowset('msdasql','driver=microsoft access text driver (*.txt, *.csv);
  3. using bulk insert or without format file.

the interesting part if use bulk insert, give me warning of unexpected end of file. solve this, have tried use various row terminator indicators '0x0a','\n', '\r\n' or not designated any, failed. , managed import of records using row terminator of ',\n'. original file contains 1000 records , 100 imported, without notice of errors or warnings.

any tips or helps appreciated.

edit 1: file ended newline character, can tell notepad++. managed import files give me error of unexpected end of file removing last record in files. method, still can not import records, partial of can imported.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -