bulk insert a date in YYYYMM format to date field in MS SQL table

前端 未结 3 747
别跟我提以往
别跟我提以往 2020-12-22 03:08

I have a large text file (more than 300 million records). There is a field containing date in YYYYMM format. Target field is of date type and I\'m using MS SQL 2008 R2 serve

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-22 03:26

    There isn't a way to do this on Bulk Insert. You have 2 options.

    1. Insert the date as into a varchar field then run a query to convert the date into a DateTime field
    2. Use SSIS

提交回复
热议问题