求助:bcp出错!

novell6789 2006-01-01 10:23:19
我从一个数据库(SYBASE12.5.0 FOR HP)中bcp某些表(表结构相同,数据不同)出来,没有错误,语法大概是:
bcp xxxx..xxxxx out xxxx.dat -c -t~ -Usa -Ppass1
拷贝到另一台服务器(SYBASE12.5.3 FOR WIN),使用bcp,语法大概是:
bcp xxxx..xxxxx in xxxx.dat -c -t~ -Usa -Ppass2
大部分都成功,只有一个表出错:
Starting copy...
1000 rows sent to SQL Server.
......
28000 rows sent to SQL Server.
CSLIB Message: - L0/O0/S0/N36/1/0:
cs_convert: cslib user api layer: common library error: The result is truncated because the conversion/operation resulted in overflow.
CSLIB Message: - L0/O0/S0/N36/1/0:
cs_convert: cslib user api layer: common library error: The result is truncated because the conversion/operation resulted in overflow.
CSLIB Message: - L0/O0/S0/N24/1/0:
cs_convert: cslib user api layer: common library error: The conversion/operation was stopped due to a syntax error in the source field.
29000 rows sent to SQL Server.
......
63000 rows sent to SQL Server.
CSLIB Message: - L0/O0/S0/N36/1/0:
cs_convert: cslib user api layer: common library error: The result is truncated because the conversion/operation resulted in overflow.
CSLIB Message: - L0/O0/S0/N36/1/0:
cs_convert: cslib user api layer: common library error: The result is truncated because the conversion/operation resulted in overflow.
CSLIB Message: - L0/O0/S0/N24/1/0:
cs_convert: cslib user api layer: common library error: The conversion/operation was stopped due to a syntax error in the source field.
64000 rows sent to SQL Server.
......
198000 rows sent to SQL Server.
CSLIB Message: - L0/O0/S0/N36/1/0:
cs_convert: cslib user api layer: common library error: The result is truncated because the conversion/operation resulted in overflow.
CSLIB Message: - L0/O0/S0/N36/1/0:
cs_convert: cslib user api layer: common library error: The result is truncated because the conversion/operation resulted in overflow.
CSLIB Message: - L0/O0/S0/N24/1/0:
cs_convert: cslib user api layer: common library error: The conversion/operation was stopped due to a syntax error in the source field.
199000 rows sent to SQL Server.
......
254000 rows sent to SQL Server.
CSLIB Message: - L0/O0/S0/N36/1/0:
cs_convert: cslib user api layer: common library error: The result is truncated because the conversion/operation resulted in overflow.
CSLIB Message: - L0/O0/S0/N36/1/0:
cs_convert: cslib user api layer: common library error: The result is truncated because the conversion/operation resulted in overflow.
CSLIB Message: - L0/O0/S0/N24/1/0:
cs_convert: cslib user api layer: common library error: The conversion/operation was stopped due to a syntax error in the source field.
CSLIB Message: - L0/O0/S0/N36/1/0:
cs_convert: cslib user api layer: common library error: The result is truncated because the conversion/operation resulted in overflow.
CSLIB Message: - L0/O0/S0/N36/1/0:
cs_convert: cslib user api layer: common library error: The result is truncated because the conversion/operation resulted in overflow.
CSLIB Message: - L0/O0/S0/N24/1/0:
cs_convert: cslib user api layer: common library error: The conversion/operation was stopped due to a syntax error in the source field.
bcp copy in partially failed

254148 rows copied.
Clock Time (ms.): total = 50172 Avg = 0 (5065.53 rows per sec.)

糟糕的是,原表已经删除了......
请问:这是什么引起的?怎么查?(90分)


另外,还有个小问题:bcp里-t后面跟的是分隔符,在上面的例子中是~,如果有某个表,包含了“~”字符,bcp回去的时候会不会出错?如果varchar字段里都包含了几乎所有的ASC字符,那该怎么办?(10分)

...全文
1092 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
novell6789 2006-01-05
  • 打赏
  • 举报
回复
lw1a2:这就去试。
hobbylu:谢谢!错误不多,自己处理了。谢谢!
再次感谢大家!
hobbylu 2006-01-05
  • 打赏
  • 举报
回复
你可以把数据和表结构发给我,我给你处理
lw1a2 2006-01-04
  • 打赏
  • 举报
回复
\n和\t等也包括吗?
lw1a2 2006-01-04
  • 打赏
  • 举报
回复
你试试导出的时候不加参数-t呢
novell6789 2006-01-04
  • 打赏
  • 举报
回复
确认了,就是字段里包括了~造成的,恨啊!

lw1a2:
如果也包括了\n和\t,有什么好办法?
dongdongxiao 2006-01-03
  • 打赏
  • 举报
回复
这样的错我以前遇到过,可能是你的表中有的主键有为''的值,这个值在导入目标表是会被认为是NULL,就会报错。
novell6789 2006-01-03
  • 打赏
  • 举报
回复
吐血啊!
那,如果有某个表,包含了几乎所有的ASC字符,该怎么bcp?
或者还有其它备份方法?(除了dump)
lw1a2 2006-01-02
  • 打赏
  • 举报
回复
应该是字段里有~造成的,你试着用UE之类的打开看看是否有办法把~改成别的
lw1a2 2006-01-02
  • 打赏
  • 举报
回复
应该是字段里用~造成的,你试着用UE之类的打开看看是否有办法把~改成别的
novell6789 2006-01-02
  • 打赏
  • 举报
回复
肯定一样,因为有几个表,结构都是一样的,只是数据不同。
其它表倒入都没问题,就这个出错。
也没有其它人动数据库。


lw1a2 2006-01-02
  • 打赏
  • 举报
回复
你能确定两个表的结构一样吗?是不是后来改过表结构?

2,598

社区成员

发帖
与我相关
我的任务
社区描述
Sybase相关技术讨论区
社区管理员
  • Sybase社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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