Reading MS Excel file from SQL Server 2005 -


i need read microsoft excel 2003 file (.xls) query in sql server 2005, , insert of data tables. reading file , using data not problem in itself, found that, column, null value instead of value that's shown in excel file. more specific: column 1 character long, , can contain 1 digit 0-9, or letter 'k'. it's when column contains 'k' query gives me null value. assumption that, since first few rows contain numbers values of column, query assumes numbers, , when finds letter turns null.

i tried changing format of cells in excel file text, , using cast , convert (not @ same time) on value try make varchar, nothing.

that looks older ole db driver excel. not doesn't work--you can still "query" spreadsheet it. maybe try newer:

select *    openrowset('microsoft.ace.oledb.12.0',             'excel 12.0 xml;hdr=yes;database=c:\file.xls',             'select * [sheet1$]')  

you'll need updated odbc driver on sql server (make sure appropriate 32 vs 64 bit version).


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -