将SQL Server数据导出到Excel [英] Export SQL Server Data into Excel

查看:72
本文介绍了将SQL Server数据导出到Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

执行此查询时显示错误.

When executing this query it shows an error.

INSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 8.0;Database=E:\Tirumalarao\Sheet1.xls;;HDR=YES','SELECT Eno,Ename,Date,DeptNo,Job,Comments,Sno FROM [Sheet1$]') 
SELECT Eno,Ename,Date,DeptNo,Job,Comments,Sno FROM  dbo.EMPLOYEE


Error:OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message "The Microsoft Office Access database engine could not find the object 'Sheet1$'.  Make sure the object exists and that you spell its name and the path name correctly.".
Msg 7350, Level 16, State 2, Line 1
Cannot get the column information from OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".

推荐答案

') 选择 Eno,Ename,日期,DeptNo,Job,Comments,Sno
') SELECT Eno,Ename,Date,DeptNo,Job,Comments,Sno FROM dbo.EMPLOYEE


Error:OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message "The Microsoft Office Access database engine could not find the object 'Sheet1


".请确保该对象存在,并且正确拼写其名称和路径名." Msg 7350,第16级,州2,第1行 无法从OLE DB提供程序"Microsoft.ACE.OLEDB.12.0"获取链接服务器(null)"的列信息.
'. Make sure the object exists and that you spell its name and the path name correctly.". Msg 7350, Level 16, State 2, Line 1 Cannot get the column information from OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".


尝试一下....
exporting-datagrid-to-excel-in-aspnet [ ^ ]
Try this....
exporting-datagrid-to-excel-in-aspnet[^]


这篇关于将SQL Server数据导出到Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆