现在有一个包含数据的文件,每个字段用“|”分隔,现在要把这些数据导入到数据库的表中。

数据文件如下:

R001|20150710

可以使用如下命令:

bcp testDB.dbo.testTable in testFeed.txt -c –t “|” -S ServerName-U dbUserName-P DBUserPassword

 

表定义:

create table dbo.testTable(
 feedOrder int,
 feedDate char(8)
)

导入后,select * from testTable

FEEDORDER   FEEDDATE

R001             20150710

相关文章:

  • 2022-12-23
  • 2021-07-11
  • 2021-08-06
  • 2021-12-10
  • 2022-12-23
猜你喜欢
  • 2021-08-27
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2021-11-05
  • 2021-12-12
  • 2021-08-04
相关资源
相似解决方案