Sql Server 2005 和 Excel 间的数据传输

xiaoxiao2021-12-07  83

1、读取excel中的数据: select * from OpenRowSet('microsoft.jet.oledb.4.0','Excel 8.0;HDR=yes;database=d:\test.xls;',[tt$]) 2、写入excel数据 insert into OpenRowSet('microsoft.jet.oledb.4.0','Excel 8.0;hdr=yes;database=c:\book1.xls;',[Sheet1$])(id,name) select * from tt 或 master..xp_cmdshell'bcp "serv-htjs.dbo.serv_user" out "c:\book2.xls" -c -q -S"." -U"sa" -P"sa"' 相关资源:SQL Server 2005数据库表导出到Excel
转载请注明原文地址: https://www.6miu.com/read-4839042.html

最新回复(0)