Categories
Sql Server

How To Insert Multiple Rows Using A Single Query Using Union All

How To Insert Multiple Rows Using A Single Query Using Union All

In this tutorial i will explain How To Insert Multiple Rows Using A Single Query Using Union All.We will insert multiple values through a single query using union all.

Query:

INSERT INTO  Employee (Firstname ,Lastname ,Salary ,Department )

SELECT 'Rajan','Singh',5000,'ERP'

UNION ALL

SELECT 'Ram','Singh',40000,'IT'

UNION ALL

SELECT 'Sachin','Kumar',15000,'HR'

UNION ALL

SELECT 'Rahul','Sharma',118000,'Admin'