SQLServer2008导入Excel数据
2656 点击·0 回帖
![]() | ![]() | |
![]() | 1、编写语句 [sql] SELECT * into newtable FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="E:\上下游目标值2012.xls";User ID=sa;Password=;Extended properties=Excel 5.0')...[se$] 2、错误提示 SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT 'OpenRowset/OpenDatasource' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用 'Ad Hoc Distributed Queries'。有关启用 'Ad Hoc Distributed Queries' 的详细信息,请参阅 SQL Server 联机丛书中的 "外围应用配置器"。 3、SQL2008 打开SQL Server Management Studio-->在左边[对象资源管理器]中选择第一项(主数据库引擎)-->右键-->方面-->在方面的下拉列表中选择[外围应用配置器]-->将'Ad Hoc Distributed Queries'置为True. | |
![]() | ![]() |