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
暂无“Select data from an Excel sheet in MSSQL”评论...
更新动态
2024年04月19日
2024年04月19日
- [ABC唱片]-《邓丽君-我怎能离开你》[6N纯银镀膜][WAV+CUE]
- 群星《千谎百计 原声音乐专辑》[320K/MP3][33.37MB]
- 群星《千谎百计 原声音乐专辑》[FLAC/分轨][95.84MB]
- 群星《城中之城 电视原声带》[320K/MP3][46.39MB]
- 于嘉珍.2001-山地情歌2辑【金桦】【WAV+CUE】
- 张洪量.1993-整个给你【滚石】【WAV+CUE】
- 吴雨霏.2015-艳羡【环球】【WAV+CUE】
- 三盲鼠之声Threeblindmice24K金御碟一听钟情重磅出击WAV
- 【TopMusic发烧天碟-胆机必备维瓦尔第《四季】SACD极致录音效果镜像.
- 甄秀珍.1988-红唇一生【宝丽金】【WAV+CUE】
- 蔡依林.2014-呸【华纳】【WAV+CUE】
- 朱仪玲.1991-露珠儿(TP版)【瑞华】【WAV+CUE】
- 郭富城.1999-游园惊梦【华纳】【WAV+CUE】
- 蔡健雅《不够善良的我们 戏剧音乐设计专辑》[320K/MP3][95.77MB]
- 蔡健雅《不够善良的我们 戏剧音乐设计专辑》[FLAC/分轨][198.75MB]