Inserting multiple rows using a single SQL query in SQL SERVER2008

CGN007
Posted by CGN007 under Sql Server category on | Points: 40 | Views : 1514
Syntax
INSERT INTO Table_Name VALUES ( Value1, Value2 ), ( Value1, Value2 )

insert into  EmployeeMas values('Raj','aaa',5000,'ERP'),('Ram','bbb',4000,'ERP'),('Sachin','ccc',5000,'MED'),('Rahul','ddd',8000,'MED')


Table creation Script
      create table EmployeeMas
(Firstname varchar(10),
Lastname varchar(10),
sal float,
Department varchar(10)
)

Comments or Responses

Login to post response