手机
当前位置:查字典教程网 >编程开发 >数据库其他 >Select data from an Excel sheet in MSSQL
Select data from an Excel sheet in MSSQL
摘要:select*fromopenrowset('Microsoft.Jet.OLEDB.4.0','Excel8.0;HDR=YES;IMEX...

select*

fromopenrowset('Microsoft.Jet.OLEDB.4.0'

,'Excel8.0;HDR=YES;IMEX=1;DATABASE=d:folderexcel.xls',Sheet1$)

-------NOTE------

SettingIMEX=1tellsthedrivertouseImportmode.Inthisstate,theregistrysettingImportMixedTypes=Textwillbenoticed.Thisforcesmixeddatatobeconvertedtotext.Forthistoworkreliably,youmayalsohavetomodifytheregistrysetting,TypeGuessRows=8.TheISAMdriverbydefaultlooksatthefirsteightrowsandfromthatsamplingdeterminesthedatatype.Ifthiseightrowsamplingisallnumeric,thensettingIMEX=1willnotconvertthedefaultdatatypetoText;itwillremainnumeric.

YoumustbecarefulthatIMEX=1notbeusedindiscriminately.ThisisIMPORTmode,sotheresultsmaybeunpredictableifyoutrytodoappendsorupdatesofdatainthismode.

ThepossiblesettingsofIMEXare:

0isExportmode

1isImportmode

2isLinkedmode(fullupdatecapabilities)

【Select data from an Excel sheet in MSSQL】相关文章:

SQL SERVER 与ACCESS、EXCEL的数据转换

数据库设计的完整性约束表现在哪些方面

数据库中删除语句Drop、Delete、Truncate的相同点和不同点的比较(实例说明)

海量数据库的查询优化及分页算法方案集合1/2第1/2页

用户管理的备份(一致性备份、非一致性备份、脱机备份、联机备份)

sqlserver、Mysql、Oracle三种数据库的优缺点总结

大数据时代的数据库选择:SQL还是NoSQL?

Sql Server 和 Access 操作数据库结构Sql语句小结

大数据量时提高分页的效率

datastage server job之dsjob 命令

精品推荐
分类导航