我使用格式如下:
exec master..xp_cmdshell 'bcp serp.dbo.iodata in c:/200410/07.txt -fc:/200410/iodata.txt -usa -p'
系统报错:
error = [microsoft][odbc sql server driver]对于造型说明无效的字符值
文本格式为:
'02','1','20041007','000330','0812','a0001'
'02','5','20041007','003105','0812','a0002'
'01','6','20041007','003415','0447','a0002'
'01','6','20041007','003417','0239','a0002'
'01','6','20041007','004422','0799','a0002'
'02','1','20041007','011803','0005','a0001'
格式文件为:
8.0
6
1 sqlchar 1 2 "," 1 door ""
2 sqlchar 1 1 "," 2 control ""
3 sqlchar 1 8 "," 3 iodate chinese_prc_ci_as
4 sqlchar 1 6 "," 4 iotime chinese_prc_ci_as
5 sqlchar 1 4 "," 5 cardno chinese_prc_ci_as
6 sqlchar 1 5 "/r/n" 6 flag chinese_prc_ci_as
数据库表格式为:
door int
control int
iodate char 8
iotime char 6
cardno char 4
flag char 5