我执行如下语句后:
use zmfz_v2
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AA]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[AA]
GO
select b.t_ma as '款式条码', a.K_shi_name as '款式名称' into AA from zc_ksbm a,zc_tm b
where a.k_shi = b.K_shi
GO
exec master..xp_cmdshell
'bcp "zmfz_v2.dbo.AA" out "C:\zzqzzq.txt" -c -q -U"sa" -P""'
正常的应该是会导出数据到C盘下面的zzqzzq.txt文档。
但现在提示这样的信息:
Operating-system error:
No such file or directory
DB-LIBRARY error:
Error in attempting to determine the size of a pair of translation tables.: Unable to access file information
NULL
请问各位兄弟们,这是什么原因啊,我在有些机器上面执行又是正常的。
在线等待ing.....
use zmfz_v2
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AA]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[AA]
GO
select b.t_ma as '款式条码', a.K_shi_name as '款式名称' into AA from zc_ksbm a,zc_tm b
where a.k_shi = b.K_shi
GO
exec master..xp_cmdshell
'bcp "zmfz_v2.dbo.AA" out "C:\zzqzzq.txt" -c -q -U"sa" -P""'
正常的应该是会导出数据到C盘下面的zzqzzq.txt文档。
但现在提示这样的信息:
Operating-system error:
No such file or directory
DB-LIBRARY error:
Error in attempting to determine the size of a pair of translation tables.: Unable to access file information
NULL
请问各位兄弟们,这是什么原因啊,我在有些机器上面执行又是正常的。
在线等待ing.....
2、sql server 版本 2005 对系统启动帐号有限制
'bcp "zmfz_v2.dbo.AA" out "C:\zzqzzq.txt" -c -q -U"sa" -P""'
------------------------------
少了个: -S
'bcp "zmfz_v2.dbo.AA" out "C:\zzqzzq.txt" -c -q -Sservername -U"sa" -P""'
能告诉我俱体要怎么写吗?还有,我这个是SQL 2000,登陆系统的是administrator,SQL用户为:SA。
应该是你的这个语句如果是在服务器上的查询分析器执行,他访问的目录就是你服务器上的目录,而如果你是在本机上的查询分析器上执行,他访问的就是你本机上的目录
而系统提示:
No such file or directory
原因就是你执行的某个机上没有C:\zzqzzq.txt这个目录
能告诉我俱体要怎么写吗?------------------------
不要写ip地址,要写服务器名称!