Sql Bulk Copy/Insert in C#

前端 未结 6 2385
北荒
北荒 2020-12-06 00:04

I am new to JSON and SQLBulkCopy. I have a JSON formatted POST data that I want to Bulk Copy/Insert in Microsoft SQL using C#.

JSON Format:

{
    \"U         


        
6条回答
  •  攒了一身酷
    2020-12-06 00:50

    If it's only 10-50 urls, being inserted infrequently, you can fire off insert statements. Simple and less hassle and you can use something easy and quick like dapper.

    Else if you want the Bulk Copy, you would need to create and fill up an ADO.NET datatable from your JSON first - preferably matching the schema of your destination sql table. It's your choice.

提交回复
热议问题