如何制作SQL生成Excel文件?
方法1:insert into OPENROWSET( 'MICROSOFT.JET.OLEDB.4.0 ' , 'Excel 5.0;HDR=YES;DATABASE=c:\test.xls ',sheet1$
) select top 5000 * from db_owner.author2方法2:EXEC master..xp_cmdshell 'bcp "select top 5000 * from db_owner.author2 " queryout "c:\test.xls " /c -/S "localhost" /U "sa" -P "1234" ' 方法3:用SQL Server的導入導出工具導出到excel