bulk

How to update and add new records at the same time

落爺英雄遲暮 提交于 2021-01-28 22:21:47
问题 I have a table that contains over than a million records (products). Now, daily, I need to either update existing records, and/or add new ones. Instead of doing it one-by-one (takes couple of hours), I managed to use SqlBulkCopy to work with bunch of records and managed to do my inserts in the matter of seconds, but it can handle only new inserts. So I am thinking about creating a new table that contains new records and old records; and then use that temporary table (on the SQL end) to update

How does bulkDelete work?

两盒软妹~` 提交于 2020-06-28 04:12:42
问题 I tried using bulkDelete to make my bot delete its message but I get this error: (node:5724) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Bad Request (node:5724) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. And here is my code: const Discord = require('discord.js'); const bot = new Discord.Client(); const config =

How does bulkDelete work?

佐手、 提交于 2020-06-28 04:12:23
问题 I tried using bulkDelete to make my bot delete its message but I get this error: (node:5724) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Bad Request (node:5724) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. And here is my code: const Discord = require('discord.js'); const bot = new Discord.Client(); const config =

C# Efficiently delete 50000 records in batches using SQLBulkCopy or equivalent library

本秂侑毒 提交于 2020-06-25 18:52:51
问题 I'm using this library to perform bulk delete in batches like following: while (castedEndedItems.Any()) { var subList = castedEndedItems.Take(4000).ToList(); DBRetry.Do(() => EFBatchOperation.For(ctx, ctx.SearchedUserItems).Where(r => subList.Any(a => a == r.ItemID)).Delete(), TimeSpan.FromSeconds(2)); castedEndedItems.RemoveRange(0, subList.Count); Console.WriteLine("Completed a batch of ended items"); } As you can see guys I take a batch of 4000 items to delete at once and I pass them as

Cannot fetch a row from OLE DB provider “BULK” for linked server “(null)”

|▌冷眼眸甩不掉的悲伤 提交于 2020-06-24 19:37:26
问题 I try to load my database with tons of data from a .csv file sized 1.4 GB. But when I try to run my code I get errors. Here's my code: USE [Intradata NYSE] GO CREATE TABLE CSVTest1 (Ticker varchar(10) NULL, dateval date NULL, timevale time(0) NULL, Openval varchar(10) NULL, Highval varchar(10) NULL, Lowval varchar(10) NULL, Closeval varchar(10) NULL, Volume varchar(10) NULL ) GO BULK INSERT CSVTest1 FROM 'c:\intramerge.csv' WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ) GO --Check the

Bulk IP configuration using CSV input

半腔热情 提交于 2020-04-30 12:13:43
问题 I have a CSV file with the following values for each machine I want to remotely reconfigure using static IP name,nic,ip,mask,defaultgw I was hoping to be able to reconfigure the IPs for each listed but if I have more than one machine listed the script gets stuck. This is because at the end of the first loop iteration, unless I manually do an ipconfig /flushdns on the server the script is running from, I will lose connection to the server being configured and the script just hangs leaving the

Bulk IP configuration using CSV input

↘锁芯ラ 提交于 2020-04-30 12:08:09
问题 I have a CSV file with the following values for each machine I want to remotely reconfigure using static IP name,nic,ip,mask,defaultgw I was hoping to be able to reconfigure the IPs for each listed but if I have more than one machine listed the script gets stuck. This is because at the end of the first loop iteration, unless I manually do an ipconfig /flushdns on the server the script is running from, I will lose connection to the server being configured and the script just hangs leaving the

c# - Best approach for a bulk update/merge on a table with high data volumne, but small change set

喜夏-厌秋 提交于 2020-02-04 02:01:19
问题 I have a table that has 200K+ rows, that I need to update on daily basis. My console app generates all this data on a daily run and needs to update the table with the results. The situation is that I'm operating on a slow and network, and at each run there is less than 0.1% rows to update/insert/delete, so clearly there's space to optimize. The table is simple - key column, plus 2 nvarchar columns. So my question is - what's the best approach in this particular case? I could always plow it

Restful PATCH on collection to update sorting parameter in bulk

点点圈 提交于 2020-02-03 04:48:51
问题 We have a big list ("collection") with a number of entities ("items"). This is all managed via a RESTful interface. The items are manually sortable via an order property on the item. When queried, the database lists all items in a collection based on the order. Now we want to expose this mechanism to users where they can update the complete sorting of all items in one call. The database does not allow the same order for the same collection_id (unique collection_id + order ), so you can't (and