sql server Bulk insert csv with data having comma

前端 未结 6 1575
刺人心
刺人心 2020-12-10 04:39

below is the sample line of csv

012,12/11/2013,\"<555523051548>KRISHNA  KUMAR  ASHOKU,AR\",<10-12-2013>,555523051548,12/11/2013,\"13,012.55\",
         


        
6条回答
  •  被撕碎了的回忆
    2020-12-10 05:05

    Well, Bulk Insert is very fast but not very flexible. Can you load the data into a staging table and then push everything into a production table? Once in SQL Server, you will have a lot more control in how you move data from one table to another. So, basically.

    1)    Load data into staging
    2)    Clean/Convert by copying to a second staging table defined using the desired datatypes. Good data copied over, bad data left behind
    3)    Copy data from the "clean" table to the "live" table
    

提交回复
热议问题