bcp简单问题?

cn_afei 2002-11-27 10:05:31
DECLARE @strExport varchar(5000)
set @strExport = 'bcp xctz_l3.dbo.users out d:\export\users.txt -c -Uwtwei -P1600'
exec master..xp_cmdshell @strExport
在查询分析器中执行返回如下错误,请教怎样解决?(bcp.exe80\tools\bin\下)
SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]无法打开 BCP 主数据文件
...全文
25 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
cn_afei 2002-11-27
  • 打赏
  • 举报
回复
高手就是高手,谢谢了
leimin 2002-11-27
  • 打赏
  • 举报
回复
语法没问题.应该是你的文件路径的问题,你在D:\有export目录么?
try:
DECLARE @strExport varchar(5000)
set @strExport = 'bcp xctz_l3.dbo.users out d:\users.txt -c -Uwtwei -P1600'
exec master..xp_cmdshell @strExport
ydr2002 2002-11-27
  • 打赏
  • 举报
回复
这样写:
set @strExport = 'bcp xctz_l3..users out d:\export\users.txt -c -Uwtwei -P1600'

22,210

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧