Extremely easy way to bulk insert data into SQL Server using SqlBulkCopy class

  Рет қаралды 11,468

DotNet Core Central

DotNet Core Central

Күн бұрын

Пікірлер: 18
@Tanghero123
@Tanghero123 Жыл бұрын
Thanks for the video. I used this for one of our projects and found it to be quite efficient. The only downside is that you need to be extra careful with things that might cause an error like duplicate primary keys, as sqlBulkCopy does not return good error messages when something goes wrong. - Chris T.
@DotNetCoreCentral
@DotNetCoreCentral Жыл бұрын
Great point, thanks!
@tayyabbhatti6781
@tayyabbhatti6781 Жыл бұрын
@@DotNetCoreCentral to eliminate this issue, you have to first count the total records by executing the query. then loop start from the count to the length. this will help you
@liamhotspur9182
@liamhotspur9182 Жыл бұрын
I love your videos, simple and straight!
@DotNetCoreCentral
@DotNetCoreCentral Жыл бұрын
thanks!
@sreenuksr
@sreenuksr Жыл бұрын
I am following your series. nice videos and explanation. Wish you happy new year.
@DotNetCoreCentral
@DotNetCoreCentral Жыл бұрын
Thanks! And wish you a Happy New Year!
@efimtenkin1641
@efimtenkin1641 Жыл бұрын
Thank you, you helped me a lot
@DotNetCoreCentral
@DotNetCoreCentral Жыл бұрын
Glad I could help!
@sravs3054
@sravs3054 5 ай бұрын
Awesome
@zulfiqar7967
@zulfiqar7967 Жыл бұрын
We can do it bulk insert in sql query itself.. it’s very safe and good performance..
@coding-gemini
@coding-gemini Жыл бұрын
Excellently explained, thanks for the video. Can you create a video for bulkupdate if any ?
@DotNetCoreCentral
@DotNetCoreCentral Жыл бұрын
Thanks!
@pardhasaradhi0076
@pardhasaradhi0076 Жыл бұрын
I have a question. Iam using bulkcopy but i would like to return identity row. Please suggest
@Thalapraga
@Thalapraga 10 ай бұрын
Can it be used for bulk insert of 10 million rows?
@Proviper666
@Proviper666 10 ай бұрын
Can some one help? System.InvalidOperationException: 'The ConnectionString property has not been initialized.' EDIT: I solved by adding direct connection string. string connectionString = "Data Source=.;Initial Catalog=YourDBname;Integrated Security=True;"; using var connection = new SqlConnection(connectionString);
@TommiLipponen
@TommiLipponen Жыл бұрын
Dear Sir, can this method be used for to copy hundreds of thousands rows from CSV file to MSSQL database?
@DotNetCoreCentral
@DotNetCoreCentral Жыл бұрын
Yes, you can first read the CSV file in chunks, add the data o the data table, and then bulk upload. I will suggest using chunks of 1000 records or some number like that to avoid memory as well as SQL Server timeout issues. But that will depend on the complexity of the data structure.
I've been using Redis wrong this whole time...
20:53
Dreams of Code
Рет қаралды 357 М.
Новый уровень твоей сосиски
00:33
Кушать Хочу
Рет қаралды 2,7 МЛН
Whoa
01:00
Justin Flom
Рет қаралды 58 МЛН
هذه الحلوى قد تقتلني 😱🍬
00:22
Cool Tool SHORTS Arabic
Рет қаралды 99 МЛН
Just Give me my Money!
00:18
GL Show Russian
Рет қаралды 1,2 МЛН
The New Way of Calling Your Code in .NET 8 Is INSANE
12:34
Nick Chapsas
Рет қаралды 137 М.
Cursor Is Beating VS Code (...by forking it)
18:00
Theo - t3․gg
Рет қаралды 92 М.
Want to build a good API? Here's 5 Tips for API Design.
10:57
CodeOpinion
Рет қаралды 205 М.
Don't Use Polly in .NET Directly. Use this instead!
14:58
Nick Chapsas
Рет қаралды 60 М.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 194 М.
Is HTMX a Joke??
32:15
Syntax
Рет қаралды 21 М.
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 804 М.
One LINQ Extension Method You NEED To Know For Cleaner EF Core Queries
11:08
Новый уровень твоей сосиски
00:33
Кушать Хочу
Рет қаралды 2,7 МЛН