Questions tagged [bulk-insert]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
10 votes
1 answer
70k views

Insert into table select * from table vs bulk insert

I just wanted to know that SQL Statement INSERT INTO TABLE1 SELECT * FROM TABLE2, will work same like bulk insert ? If no, Is there any way exclude index while inserting records. Process is inserting ...
Virul Patel's user avatar
11 votes
1 answer
5k views

Foreign keys become untrusted after bulk insert

In a SQL 2014 edition server (12.0.2430.0 - no SP1 yet) with a database in 2012 compatibility mode (working on getting it switched to 2014...) I have a handful of foreign key objects which are ...
LowlyDBA - John M's user avatar
6 votes
3 answers
6k views

MySQL INSERT INTO SELECT vs BULK INSERTs performance

Currently, I am trying to copy data from TABLE1 to TABLE2. In terms of insertions performance, would it be the same or faster if I would to do BULK INSERT manually (i.e BULK insert every 10K records ...
CloudNineHorizon's user avatar
3 votes
1 answer
4k views

Bulk insert in multiple tables

I have two tables on which I perform some bulk inserts: key: key_id (pk), key_name related_key: related_key_id (pk), key_id (fk) First INSERT: values_data = "($$key_1$$), ($$key_2$$)" INSERT INTO ...
RockNinja's user avatar
  • 683
6 votes
3 answers
6k views

How to retrieve a large text from inside a table?

for my own records I have a table in one of my servers where I like to save my activities and scripts the table definition is: IF OBJECT_ID('[dbo].[activity]') IS NOT NULL DROP TABLE [dbo].[...
Marcello Miorelli's user avatar
10 votes
2 answers
27k views

Unnest multiple arrays into rows

I have been shown a great way to bulkinsert with this example: WITH p AS ( INSERT INTO parent_table (column_1) SELECT $1 RETURNING id) INSERT INTO child_table (parent_table_id, ...
user avatar
9 votes
1 answer
1k views

Minimal Logging Conditions in SQL

I have written a script to test out the claims made on this page http://technet.microsoft.com/en-us/library/dd425070(v=sql.100).aspx in the table titled Summarizing Minimal Logging Conditions about ...
user avatar
8 votes
1 answer
6k views

Why is Insert-Ignore so expensive in MySQL?

TL;DR: Inserting a large number of rows with no collisions is MUCH faster than (not) re-inserting the same rows, BOTH using the INSERT IGNORE syntax. Why is this? I would assume that the index lookup ...
Mark Gerolimatos's user avatar
3 votes
1 answer
3k views

SQL Bulk Insert Impersonation issue

I am running Microsoft SQL Server 2012 SP on a Windows Server 2008 R2 Standard SP1 box. The SQL Server service is running as a simple windows domain user (nothing special, no admin rights, etc.) I am ...
Jim's user avatar
  • 245
2 votes
1 answer
4k views

Increased performance from single statement, multiple row inserts?

I'm currently obsessing over bulk inserts via prepared statements with libpqxx. I am far from a database expert and even further when it comes to Postgres, but just thinking superficially, it doesn't ...
user avatar
1 vote
1 answer
148 views

SQL Server stored proc locking, serialization

Stored proc in SQL Server INSERT INTO table1 value sets A , B Value set A has as one of its parameters: (SELECT TOP 1 cashbalance - 1 FROM table1 WHERE userid = __ ORDER BY createdUTC, ID) Value set B ...
M S's user avatar
  • 21
1 vote
1 answer
69 views

mysql bulk insert with constraints

I created a table like this, CREATE TABLE Leaderboard( userId bigint not null, matchId bigint not null, score mediumint not null, country CHAR(10), tournamentId int not null ) ...
umarkaa's user avatar
  • 35
0 votes
1 answer
1k views

BULK INSERT: Trials and Tribulations

I recently ran into several problems with a BULK INSERT task, so I thought I'd share my experiences. I'm not looking for help, just offering help for others that may experience something similar in ...
mpag's user avatar
  • 968