Ashish Vishwakarma

Ashish Vishwakarma

  • 357
  • 4.4k
  • 1.4m

Best Approach to Save Data into SQL Server?

Mar 23 2016 1:15 AM
I have few records to save into database, approx 12 KB each. They are coming as bunch of 10 to 15 Records. I have option of 2 approaches to follow.
 
 1. Iterating Records in C# and sending them one by one to Database to save. (10 to 15 requests to DB 12 KB each).
 2. Pushing all records at once in DB, and let the stored procedure do the Jobs of Iterating and saving each record. (Only one request to DB 120KB to 180KB).
 
This is  gonna be used in a job which is configured to run everyday midnight. Please suggest which is approach is better and why?
 

Answers (3)