SET @FilePath='D:\TEST.xls' SET @sql='bcp "SELECT * FROM XXX.dbo.XXX WITH(NOLOCK) WHERE XXX=''XXX'' AND XXX = '+@XXX+'" QueryOut '+@FilePath+' -c -T ' EXEC master..xp_cmdshell @SQL…
导出数据到Excel通用的方法类,请应对需求自行修改. 资源下载列表 using System.Data; using System.IO; namespace IM.Common.Tools { public class Export { public string Encoding = "UTF-8"; System.Web.HttpResponse response = System.Web.HttpContext.Current.Response; public void Ec…