We have different ways to insert data in table. In this blog you will learn how to insert data using SELECT and UNION ALL statements.
The following script helps to create the table.
- Create table Mas_Employee(
- Id int primary key identity(1,1),
- Name varchar(50),
- Salary int ,
- DeptId int
- )
Insert data into table using SELECT and Union
- insert into Mas_Employee ( Name, Salary, DeptId )
- select 'Jaipal',18200,1 union all
- select 'Jayanth',14200,2 union all
- select 'Sreeshanth',12999,2 union all
- select 'Tejaswini',16800,1
I hope you enjoyed it. Please provide your valuable suggestions and feedback if you found this article helpful.

Hasan KILICPosted Jan 3, 2023, 11:14 AM
Hello, how can I insert from different textboxes values to a table for each row. For example, 3 serial numbers for 3 textboxes.text and insert them serial_table in database with a button click event. and is it possible to do it with store procedure also? Thank u.
SubashPosted Aug 20, 2016, 4:42 AM
Useful for beginners