I'm trying to import data from CSV file using open data row set, below is the command used. one of the column has mix of integer and character(75/1000). As SQL server consider the column as INT, it returns columns with character as NULL. I tried to have
only records with character but the data type got changed to Money and columns with more than one character shown as null. Modified few registry settings it worked for excel but not for CSV.
SELECT *
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0','Text;IMEX=1;Database=F:\'
,'SELECT * FROM [TEST.csv]')
Modified below registry settings:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Jet\4.0\Engines\Text
ImportMixedTypes=Text <<FOr CSV>>
Hkey_Local_Machine/Software/Microsoft/Jet/4.0/Engines/Excel/
TypeGuessRows = 0 <<FOR EXCEL>>
vs