select *
from openrowset('Microsoft.Jet.OLEDB.4.0'
,'Excel 8.0;HDR=YES;IMEX=1;DATABASE=d:\folder\excel.xls',Sheet1$)
-------NOTE------
Setting IMEX=1 tells the driver to use Import mode. In this state, the registry setting ImportMixedTypes=Text will be noticed. This forces mixed data to be converted to text. For this to work reliably, you may also have to modify the registry setting, TypeGuessRows=8. The ISAM driver by default looks at the first eight rows and from that sampling determines the datatype. If this eight row sampling is all numeric, then setting IMEX=1 will not convert the default datatype to Text; it will remain numeric.
You must be careful that IMEX=1 not be used indiscriminately. This is IMPORT mode, so the results may be unpredictable if you try to do appends or updates of data in this mode.
The possible settings of IMEX are:
0 is Export mode
1 is Import mode
2 is Linked mode (full update capabilities)
from openrowset('Microsoft.Jet.OLEDB.4.0'
,'Excel 8.0;HDR=YES;IMEX=1;DATABASE=d:\folder\excel.xls',Sheet1$)
-------NOTE------
Setting IMEX=1 tells the driver to use Import mode. In this state, the registry setting ImportMixedTypes=Text will be noticed. This forces mixed data to be converted to text. For this to work reliably, you may also have to modify the registry setting, TypeGuessRows=8. The ISAM driver by default looks at the first eight rows and from that sampling determines the datatype. If this eight row sampling is all numeric, then setting IMEX=1 will not convert the default datatype to Text; it will remain numeric.
You must be careful that IMEX=1 not be used indiscriminately. This is IMPORT mode, so the results may be unpredictable if you try to do appends or updates of data in this mode.
The possible settings of IMEX are:
0 is Export mode
1 is Import mode
2 is Linked mode (full update capabilities)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
岱庙资源网 Copyright www.zgmyg.com
暂无“Select data from an Excel sheet in MSSQL”评论...
更新日志
2024年04月29日
2024年04月29日
- 陈芯怡.2023-漫行日志【鼎乐】【FLAC分轨】
- 韩宝仪《舞女泪》24K黄金母盘直刻 正版CD低速原抓[WAV+CUE][463M]
- 群星《2024上海国际高端音影展纪念版CD》[WAV分轨][415M]
- 邓丽君《闽南语金曲集》[DSF][1G]
- dnf第10季战令奖励一览
- dnf结婚戒指怎么升级
- dnf继承怎么保留附魔
- 《重装岚影》成就列表一览
- 《百英雄传》:像素群像剧与英雄们的赞美诗
- 《下一站江湖Ⅱ》评测:一块仍需打磨的璞石
- 龙飘飘-人财两旺富贵全-2023-WAV分轨
- 迪克牛仔-国语真经典台湾首版-2005-WAV+CUE
- FrancescaTandoi,MatheusNicolaiewskySanderSmeets-BopWeb(2024Jazz)[Flac24-96]
- 《剑星》遭和谐影响深远:玩家担心《GTA6》被审查
- 世界最贵在售房产 法国达玛雅克城堡出售:33亿人民币