Article Information
This SQL Tutorial contains and tries to cover following subjects:
- Explanation of inserting multiple rows into table in sql.
- Example to insert multiple row in sql
Articles tries to provide answer to following questions
- How to insert multiple rows into table in sql?
- How to insert multiple rows in a single INSERT in sql?
Article covers followings indirectly:
- INSERT command
Articles pre-requisites following information:
- General knowledge of SQL Server Management Studio
- General knowledge of INSERT command
Inserting multiple rows in same INSERT command in SQL
Iserting multiple rows into table in sql is another method of inserting data into table. If you recall, we had covered inserting a simple row into sql. It is possible to insert more than one rows in same INSERT command to table in sql. Lets remember syntax of inserting a row into table.
INSERT (column1, column2) VALUES (value1, values2)
To insert multiple rows into table in sql, we need to add a comma and second row as follows:
INSERT (column1, column2) VALUES (value1, values2), (value3, values4)
Lets see it in a sql example as practice to insert multiple rows in a single INSERT.
As above indicates, multiple rows have been inserted into the table. We provided two column name and two row - four value to be inserted. New rows are added to table.