.NET | Persist multiple objects in minimum number of queries

Posted by VarunGupta on Stack Overflow See other posts from Stack Overflow or by VarunGupta
Published on 2010-04-02T12:01:49Z Indexed on 2010/04/02 12:03 UTC
Read the original article Hit count: 228

Filed under:
|
|
|
|

I have a list of objects which needs to be persisted in a SQL Server database table, where each object gets persisted as single record. i.e. List of objects result in insertion of multiple records.

Trivial way of saving the objects is to loop over the list and fire a query/stored procedure/etc. for saving that record. But this results in multiple database interactions.

Is there a way to persist the list of objects in lesser number of database interactions?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about c#