我应该做一个简单的任务:使用ISQL
,从Sybase数据库获取数据并使用BCP
实用程序将生成的CSV文件插入SQL Server数据库的表中。
我尝试了一些引用/未引用数据,格式文件等的排列,但BCP继续抛出同样的错误:
开始复制......
SQLState = S1000,NativeError = 0
错误= [Microsoft] [SQL Server Native Client 11.0]数据类型的字段大小无效 SQLState = S1000,NativeError = 0
传入的数据文件由九列组成:
"he1aixp9-2","srcpdb",20150701,20150731,"N","IBM UDB","udbxsrcp_sby",202025,196358
我使用BCP
实用程序使用每列的建议默认值为相关表生成格式文件:
11.0
9
1 SQLCHAR 2 32 "," 1 ID_ETY_SVR SQL_Latin1_General_CP1_CI_AS
2 SQLCHAR 2 32 "," 2 ID_ETY_DB SQL_Latin1_General_CP1_CI_AS
3 SQLDATE 1 3 "," 3 DT_SMPL_BEG ""
4 SQLDATE 1 3 "," 4 DT_SMPL_END ""
5 SQLCHAR 2 1 "," 5 FLAG_DEL SQL_Latin1_General_CP1_CI_AS
6 SQLCHAR 2 64 "," 6 TYPE_DB SQL_Latin1_General_CP1_CI_AS
7 SQLCHAR 2 32 "," 7 ID_ETY_HOST SQL_Latin1_General_CP1_CI_AS
8 SQLBIGINT 1 8 "," 8 ID_ETY_SPACE_TOTAL ""
9 SQLBIGINT 1 8 "" 9 ID_ETY_SPACE_USED ""
我正在使用以下命令行来调用该进程:
"\Program Files\Microsoft SQL Server\110\Tools\Binn\bcp" [table_to_load] in [Data File to be loaded] -S[server] -[database] -T -fDBLoad.fmt
到目前为止,我已经完成了以下工作:
这是一个微不足道的问题,但我无法让BCP
加载数据。