积极答复者
bcp命令导入数据的ASCII码错误解决方法请教

问题
-
====table: [TESTDB].[TEST_SCHEMA].[TEST_TBL]
====column information:
ID CHAR(2) NOT NULL
BODY CHAR(5) NOT NULL
====import date: [TEST.seq] (? = ASCII code > hex 80 = dec 128 )0112345 ---------OK
02abcde ---------OK
03?2345 ---------OK
0412?45 ---------OK
051234? ---------error line
====format file:
11.0
2
1 SQLCHAR 0 2 "" 1 ID Japanese_XJIS_100_CS_AS_KS_WS
2 SQLCHAR 0 5 "" 2 BODY Japanese_XJIS_100_CS_AS_KS_WS====bcp command:
bcp [IJI].[TEST_TBL] in D:\rdbin\WK\TEST.seq -f D:\rdbin\WK\TEST.FMT -T======问题
error line 这一行已经找到方法可以导入数据库,但是再导出后可以通过工具比较发现,导入导出文件不一致。差异在于标记?的地方ascii码为80以上的值都变为ascii码20(空格)。求教解决方法。
答案
-
You may need unicode data type here, try with nchar instead of char.
- 已标记为答案 Nan YuMicrosoft contingent staff, Moderator 2015年8月25日 2:01
-
没戏,日本字符集对128-254的字符解释和标准不一样
想不想时已是想,不如不想都不想。
- 已标记为答案 Nan YuMicrosoft contingent staff, Moderator 2015年8月25日 2:01
全部回复
-
You may need unicode data type here, try with nchar instead of char.
- 已标记为答案 Nan YuMicrosoft contingent staff, Moderator 2015年8月25日 2:01
-
没戏,日本字符集对128-254的字符解释和标准不一样
想不想时已是想,不如不想都不想。
- 已标记为答案 Nan YuMicrosoft contingent staff, Moderator 2015年8月25日 2:01