求助:本地Excel远程导入SQL
秋天之落叶 2019-03-01 04:33:42 连查询带瞎蒙,弄了两句,翻来覆去的提示错误:
insert into OPENDATASOURCE('SQLOLEDB','Data Source=xxx.x.xx.xxx;User ID=sa;Password=sa').hyzx.dbo.ceshi(a,b)
select a,b FROM OpenDataSource( 'Microsoft.ACE.OLEDB.12.0','Data Source="D:/test.xlsx";Extended properties="Excel 12.0;HDR=yes" ')...[Sheet1$]
消息 7314,级别 16,状态 1,第 7 行
链接服务器 "(null)" 的 OLE DB 访问接口 "Microsoft.ACE.OLEDB.12.0" 不包含表 "Sheet1$"。该表不存在,或者当前用户没有访问该表的权限。
insert into OPENDATASOURCE('SQLOLEDB.1','Data Source=xxx.x.xx.xxx;User ID=sa;Password=sa').hyzx.dbo.ceshi(a,b)
SELECT a,b from openrowset('Microsoft.ACE.OLEDB.12.0','excel 12.0;hdr=yes;imex=2;database="d:\test.xlsx"',[Sheet1$])
链接服务器"(null)"的 OLE DB 访问接口 "Microsoft.ACE.OLEDB.12.0" 返回了消息 "不能更新。数据库或对象为只读。"。
消息 7303,级别 16,状态 1,第 8 行
无法初始化链接服务器“(null)”的 OLE DB 访问接口“Microsoft.ACE.OLEDB.12.0”的数据源对象。
哪位大神给看看,错在哪里,如何修改?