尝试通过bcp将CSV文件上传到Azure。命令将运行并返回0行复制。
我怀疑这是格式化问题,但我无法弄清楚在哪里。任何帮助将不胜感激!
文件格式:
FIELD1,FIELD2,字段3,字段4,字段5,字段6,字段7,字段8,字段9,字段10,field11,field12,field13,field14
格式文件:
12.0 14 1 SQLCHAR 2 100“”1 field1 SQL_Latin1_General_CP1_CI_AS 2 SQLCHAR 2 100
“”2 field2
SQL_Latin1_General_CP1_CI_AS 3 SQLCHAR 2 100
“”3 field3
SQL_Latin1_General_CP1_CI_AS 4 SQLCHAR 2 100
“”4 field4
SQL_Latin1_General_CP1_CI_AS 5 SQLCHAR 2 100
“”5 field5
SQL_Latin1_General_CP1_CI_AS 6 SQLCHAR 2 100
“”6 field6
SQL_Latin1_General_CP1_CI_AS 7 SQLCHAR 2 100
“”7 field7
SQL_Latin1_General_CP1_CI_AS 8 SQLCHAR 2 100
“”8 field8
SQL_Latin1_General_CP1_CI_AS 9 SQLCHAR 2 100
“”9 field9
SQL_Latin1_General_CP1_CI_AS 10 SQLCHAR 2 100
“”10 field10
SQL_Latin1_General_CP1_CI_AS 11 SQLCHAR 2 100
“”11 field11
SQL_Latin1_General_CP1_CI_AS 12 SQLCHAR 2 100
“”12 field12
SQL_Latin1_General_CP1_CI_AS 13 SQLCHAR 2 100
“”13 field13
SQL_Latin1_General_CP1_CI_AS 14 SQLCHAR 2 100
“”14 field14
SQL_Latin1_General_CP1_CI_AS
Powershell命令:
bcp tableName in C:\FileToLoad.csv -c -f fileFormat-c.fmt -S serverName -d databaseName -U user -P password