Back to list
Views:   3.5K
Replies:  1
Archived

Insert list in one transaction

Hi,
As have study the current pattern I can only insert 1 record at a time(one object) When I need to insert a List<object>. I would like to do this in one transaction. For example I have 100 records doing it one by one in a loop takes a long time. There must be a better way to do this.

Thanks,

Alan


Alan Anderson, Sep 08, 2016
Reply 1
Generate Query with string builder  and  

var sql=@"";

use db,execute(sql);

https://www.mssqltips.com/sqlservertutorial/3305/what-does-begin-tran-rollback-tran-and-commit-tran-mean/
Pranav Patil, Sep 21, 2016


Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Licensing       EULA       Sitemap      
© Data & Object Factory, LLC.
Made with    in Austin, Texas