BULK INSERT with inconsistent number of columns

前端 未结 5 1510
名媛妹妹
名媛妹妹 2020-12-10 07:21

I am trying to load a large amount data in SQL server from a flat file using BULK INSERT. However, my file has varying number of columns, for instance the first row contains

5条回答
  •  青春惊慌失措
    2020-12-10 08:10

    BULK INSERT isn't particularly flexible. One work-around is to load each row of data into an interim table that contains a single big varchar column. Once loaded, you then parse each row using your own routines.

提交回复
热议问题