日期:2014-05-17  浏览次数:20699 次

Error = [Microsoft][SQL Server Native Client 10.0]无法打开 BCP 主数据文件 错误 望高手给解决 谢谢啦
在cmd下执行  bcp "select top 10 userid,username from C6.dbo.USERS order by USERID asc"  queryout E:\roy_1.xls -c -t  -S"192.168.0.xxx" -U xx-P xxxxx
能够成功导出 
但是在查询分析器下执行 
EXEC sp_configure 'show advanced options', 1
GO
-- 重新配置
RECONFIGURE
GO
-- 启用xp_cmdshell
EXEC sp_configure 'xp_cmdshell', 1
GO
--重新配置
RECONFIGURE
GO
exec   master..xp_cmdshell   'bcp "select top 10 userid,username from C6.dbo.USERS order by USERID asc"  queryout E:\roy_1.xls -c -t  -S"192.168.0.xxx" -U xxx -P xxxxxx
却报错如下:
SQLState = S1000, NativeError = 0;
Error = [Microsoft][SQL Server Native Client 10.0]无法打开 BCP 主数据文件;

这是为什么呢  望高手指点
------解决方案--------------------
exec   master..xp_cmdshell   'bcp "select top 10 userid,username from C6.dbo.USERS order by USERID asc"  queryout E:\roy_1.xls -c -t  -S"192.168.0.xxx" -U xxx -P xxxxxx'
------解决方案--------------------
C6 呵呵 暴露库名后果可能很严重哦