简体   繁体   English

将存储过程结果导出到Excel工作表

[英]Exporting stored procedure result to excel sheet

Exporting stored procedure result to excel with column name 使用列名将存储过程结果导出到excel

I looked at the link above and created stored procedure. 我查看了上面的链接并创建了存储过程。 I am not getting data into ExcelSheet I have created in D:\\testing.xls and D:\\data_file.xls 我没有将数据导入在D:\\ testing.xls和D:\\ data_file.xls中创建的ExcelSheet中

Errors List

1.usage: bcp {dbtable | query} {in | out | queryout | format} datafile
  [-m maxerrors]            [-f formatfile]          [-e errfile]
  [-F firstrow]             [-L lastrow]             [-b batchsize]
  [-n native type]          [-c character type]      [-w wide character type]
  [-N keep non-text native] [-V file format version] [-q quoted identifier]
  [-C code page specifier]  [-t field terminator]    [-r row terminator]
  [-i inputfile]            [-o outfile]             [-a packetsize]
  [-S server name]          [-U username]            [-P password]
  [-T trusted connection]   [-v version]             [-R regional enable]
  [-k keep null values]     [-E keep identity values]
  [-h "load hints"]
NULL

2.The system cannot find the file specified.
NULL

3.Could Not Find D:\data_file.xls
NULL

Well may be following script will be useful to you. 好吧,下面的脚本可能对您有用。

INSERT INTO OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0','Data Source={\\Operations\Output\CR_20071130.xls};Extended Properties=Excel 8.0')..
[Sheet1$A1:H1] exec YourStoredProcedure

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM