当前位置:数据库 > Excel >>

表t_icitem,需要通过语句把这张表里面的FNumber,FNameEn,FModel,FChartNumber等字段引出并新建到excel上

我的语句写了。数据库名AIS20120829145139 表名t_icitem,服务器名 IST-KINGDEE 用户名sa 密码sa  EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE; EXEC master..xp_cmdshell 'bcp AIS20120829145139.dbo.t_icitem out c:\temp.csv -c -q -"IST-KINGDEE" -"sa" -"sa"' 执行也没问题,但是结果却是这样。也没有任何文件产生在我的c盘路径下。 bcp: unknown option I 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"] [-x generate xml format file] NULL 有高手知道我这语句是哪里出错吗? 我觉得是bcp用法有错,但是又找不出哪里错。请高人帮助, 测试完成后,再加500分。决不食言。
追问:这个是可以的.但是我用了任何帐户执行后都提示无法登陆.
提示帐户登陆失败..导入导出工具,能达到我的要求吗?
请问是什么工具,能介绍一下吗?我看了下,达不到我的要求
我要把有几个表里的一些子项一起输出为一个csv文件。
你这个只有导出整个表。对我来说没意义。哪跟查询管理器一样的呀。没啥区别。
答案:EXEC master..xp_cmdshell 'bcp AIS20120829145139.dbo.t_icitem out c:\temp.csv -c -q -"IST-KINGDEE" -"sa" -"sa"'
改为
 
EXEC master..xp_cmdshell 'bcp AIS20120829145139.dbo.t_icitem out c:\temp.csv -c -q -S"数据库服务器电脑名" -U"sa" -P"sa"'
其他:为什么用bcp呢,
 
为什么不  用sqlserver的导入导出工具  试试呢? 

上一个:sqlserver 连接查询的问题,a表无重复记录,与b表中的记录为1对N关系,如何在查得a表信息时统计b表记录数
下一个:PL/SQL的 "COPY TO EXCEL "功能时候,excel中中文数据乱码,求解

Oracle
MySQL
Access
SQLServer
DB2
Excel
SQLite
SYBASE
Postgres
如果你遇到数据库难题:
请访问www.zzzyk.com 试试
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,