Linked Questions
83 questions linked to/from Inserting multiple rows in a single SQL query?
625
votes
18
answers
903k
views
Insert multiple rows WITHOUT repeating the "INSERT INTO ..." part of the statement? [duplicate]
I know I've done this before years ago, but I can't remember the syntax, and I can't find it anywhere due to pulling up tons of help docs and articles about "bulk imports".
Here's what I want to do, ...
2
votes
3
answers
32k
views
Insert multiple rows of data in a single SQL statement [duplicate]
I have multiple set of data to insert at once
INSERT INTO MyTable VALUES ("John", "Doe", 1234567890, "employee", "");
INSERT INTO MyTable VALUES ("Susen", "Gupta", 1234567890, "leander");
INSERT INTO ...
5
votes
3
answers
4k
views
Multiple INSERT queries turned into one single query [duplicate]
I've searched through Stackoverflow and nothing answers my question properly.
My question is how do you turn multiple INSERT queries into 1 single insert query.
More specific; https://gist.github....
6
votes
2
answers
836
views
I have an incorrect syntax error [duplicate]
INSERT INTO FoodLog
(Person,Food,ServingSize,Date,Meal)
VALUES
('John','Cheerios',2,'1-APR-2014','Breakfast')
('John','TBoneSteak',1,'2-APR-2014','Lunch')
In this code, the first line of code works ...
3
votes
3
answers
857
views
Is it possible to insert the same values at once (Mysql)? [duplicate]
If i have a table that Example is and one coloumn in it that (for example) colour is how i can do something like;
INSERT INTO Example VALUES ('Red','Black','Green');
instead of writing the code 3 ...
9
votes
1
answer
828
views
How to insert data in a batch? [duplicate]
In MySQL, I could fire off these statements to insert 5 rows in one shot:
CREATE TABLE t (id int primary key auto_increment)
INSERT INTO t VALUES (DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT)
How ...
34
votes
10
answers
298k
views
Insert multiple rows into single column
I'm new to SQL, (using SQL 2008 R2) and I am having trouble inserting multiple rows into a single column.
I have a table named Data and this is what I am trying
INSERT INTO Data ( Col1 ) VALUES
('...
21
votes
2
answers
157k
views
Insert Multiple Rows Into Temp Table With SQL Server 2012 [duplicate]
These StackOverflow questions here, here, and here all say the same thing, but I can't get it to run in SSMS or SQLFiddle
CREATE TABLE #Names
(
Name1 VARCHAR(100),
Name2 VARCHAR(100)
)
...
13
votes
5
answers
101k
views
Fastest way to insert 1 million rows in SQL Server [duplicate]
I am writing a stored procedure to insert rows into a table. The problem is that in some operation we might want to insert more than 1 million rows and we want to make it fast. Another thing is that ...
3
votes
2
answers
35k
views
Multiple INSERT INTO statements not working in dbeaver
I am trying to insert data into a table and I have written multiple Insert Into statements but I am facing an issue which is quite strange. When I run whole script, it gives me error that invalid ...
6
votes
5
answers
33k
views
Insert values from a list in a single SQL statement
I have a list with values in it. I want to insert these values in a SQL table using a single INSERT statement.
Example: Say, there is a list with names (the size of the list is not constant). There ...
4
votes
5
answers
4k
views
Error INSERT INTO MySQL Table
Learning PHP with MYSQL from w3schools. Everything is going fine but when i am trying to enter multiple value into table and it shows below error.
Error INSERT INTO MyGuests (firstname, lastname, ...
0
votes
5
answers
5k
views
Insert multiple set of values using Sqlite [closed]
I want to add multiple items/rows in SQLite using single insert query,
insert into suppliers (supoliers_no,supply_name,city,phone_no)
values (1,'Ali','amman',111111), (2,'tariq','amman',777777)...
7
votes
1
answer
7k
views
How to insert multiple rows in Web SQL Database?
I have a JavaScript object with multiple rows of data and I want to insert it into web sql database.
Here is how my code looks like.
for(i in rows)
{
(function(row){
db.transaction(...
-3
votes
2
answers
4k
views
Inserting multiple rows in one table with just one insert commnad
A little hard to explain in SQL terms because I am using an in-house technology but Let's say I have an array of a structs (similar to structs we have in C#, C++, etc) and I want to insert its values ...