SQL 命令行实用程序 (BCP)

SQL Command Line Utility (BCP)

我正在尝试对数据库进行批量插入,但出现以下错误:

SQLState = S0002, NativeError = 208
Error = [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Invalid object name 'CLAIMS'.
SQLState = 37000, NativeError = 11529
Error = [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]The metadata could not be determined because every code path results in an error; see previous errors for some of these.

使用的命令行语句如下:

C:\Users\back Office>BCP CLAIMS_CAS_ALL_2004_UPDATED_20101002_HUMANA IN "E:\Health Data\Claims\Claims\Data\CLAIMS_CAS_ALL_2004_UPDATED_20101002_HUMANA.txt" -t, -f "E:\Health Data\Claims\Claims\Format_Files\CLAIMS_CAS_ALL_2004_UPDATED_20101002_HUMANA_Format.txt"-SBACKOFFICE-PC -T

用数据库名称限定 table 名称,或添加参数 [-d database name].

https://msdn.microsoft.com/en-us/library/ms162802.aspx

bcp [database_name.] schema.{table_name | view_name | "query" {in data_file | out data_file | queryout data_file | format nul}
  [-a packet_size]
  [-b batch_size]
  [-c]
  [-C { ACP | OEM | RAW | code_page } ]
  [-d database_name]
  [-e err_file]
  [-E]
  [-f format_file]
  [-F first_row]
  [-h"hint [,...n]"] 
  [-i input_file]
  [-k]
  [-K application_intent]
  [-L last_row]
  [-m max_errors]
  [-n]
  [-N]
  [-o output_file]
  [-P password]
  [-q]
  [-r row_term]
  [-R]
  [-S [server_name[\instance_name]]
  [-t field_term]
  [-T]
  [-U login_id]
  [-v]
  [-V (80 | 90 | 100 | 110)]
  [-w]
  [-x]
  /?