I am working with Dapper .net for Bulk insert operation in SQL Tables. I am thinking to user SQKBulk copy with Dapper .Net but don't have any experience How to use SqlbulkCopy with Dapper .Net
your help is Highly appreciated
It is not good idea to use dapper for bulk insert, because there it will not fast. The better case for this is use of SqlBulkCopy class. But if you want use Dapper for bulk insert, you can find solution here.
Related
I am writing a Azure Web job c# code for doing Bulk Insertion and Update in an existing Azure SQL Database.
Considering the performance which .NET data access technology should I select-ADO.NET/Linq2SQL/EF-DataFirst approach ?
Raw ADO.NET with SqlBulkCopy will alway give you the best performance, as the other technologies are abstraction layers on top of ADO.NET
How to do multiple insert (50000 record) as well update using dapper .net ?
Is it possible to use SqlBulkCopy to achieve this? If yes then how?
Is there any best way to implement multiple hierarchical insert or update using Dapper.net?
Technologies : C#, SQL Server 2012, Dapper.net
If you just want to insert: SqlBulkCopy should be fine; if you want an "upsert", I suggest table-valued-parameters (which dapper supports) and the merge t-sql operation
Dapper just simplifies ado.net; if you think of a way to do it in ado.net, dapper can probably make it easier for you; however, it sounds like multiple TVPs might suffice
If you are mean to OK and able to segregate insert and update entities separately then I would suggest to use Dapper.Contrib library provided by Dapper.Net guys themselves. It is available via nuget. It has worked very efficiently for my project.
Here is the link to their Github project page.
After some goŠ¾gling, I could not find a proper replacement of SQLBulkCopy from SQLClient in Npgsql. Can any body suggest me anything like SQLBulkCopy for PostgreSQL? I need to insert around 10 millions of data.. I know about making single query insertion...
I am just doing test for comparison purpose.
Any suggestion is appreciated.
Very old now, but note that Npgsql 3 includes an optimized binary bulk copy functionality, see the docs (3.0).
I have gone through an article of using EntityConnection, EntityCommands for executing Entity sql queries. But I was unable to understand that Why are we using Entity sql? Why not directly using the Classes and objects for processing CRUD operations on database?
Or If we want to execute sql queries then why we are using Entity Sql , why not directly Ado.net ?
Is there any performance difference or something else?
I have already gone through the page http://msdn.microsoft.com/en-us/library/bb738573.aspx. But I want answer in a more simpler way. Can you please answer me?
Thanks
Why not directly using the Classes and objects for processing CRUD operations on database?
That is (should be) the way for almost all operations. But sometimes there is a need for accessing the db more directly and precisely.
If we want to execute sql queries then why we are using Entity Sql , why not directly Ado.net ?
E-SQL will still let you work with entities (instead of Rows). This is much easier and more powerful, consider inheritance for example.
E-SQL is also supposed to be independent of the actual database, ie the same for Oracle etc. I have no experience with this yet.
Is there any performance difference or something else?
It can be used to improve performance, yes. But not automatically.
The main difference
SQL is database dependent query language working on storage (relational) objects - tables / rows
ESQL is database independent query language working on conceptual (EDMX) objects - entities
ESQL was created prior to LINQ. In some scenarios ESQL offers more functionality than LINQ.
I'm interested to find out which ORM has best support for Postgres SQL database? Does any mapper have, both, LINQ support and ability to generate model from database?
I haven't compared it against DbLinq but LlbgenPro supports Postgres and is very strong. It supports both Linq and generating the model from the database. In it's just released v3.0 it can generate projects not just for the LlblGen runtime but also for NHibernate, Entity Framework and LinqToSql.
It should be in your list to evaluate.
I would say NHibernate is your friend here.
Quite an old question, but for anyone happening upon this now (like me), please do check out the Marten document & event store for PostgreSQL/.net
DbLinq
You can use NEntityDb. With NEntityDb for PostgreSQL you can query and save data to the database with .NET LINQ Expressions and Fluent API.