Congratulations to all monthly winners of May 2013 !!! They have won INR 2900 cash and INR 27497 worth prize.
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 7142 |  Welcome, Guest!   Register  Login
 Home > Code Snippets > SQL Server > Inserting multiple rows using a single SQL query in SQL SERVER2005 using UNION ALL ...
CGN007

Inserting multiple rows using a single SQL query in SQL SERVER2005 using UNION ALL

 Code Snippet posted by: CGN007 | Posted on: 6/28/2012 | Category: SQL Server Codes | Views: 1222 | Status: [Member] | Points: 40 | Alert Moderator   
Ads

SQLSERVER2005

INSERT INTO  EmployeeMas (Firstname ,Lastname ,sal ,Department )

SELECT 'Raj','aaa',5000,'ERP'
UNION ALL
SELECT 'Ram','bbb',4000,'ERP'
UNION ALL
SELECT 'Sachin','ccc',5000,'MED'
UNION ALL
SELECT 'Rahul','ddd',8000,'MED'



Table creation Script

CREATE TABLE EmployeeMas


(Firstname varchar(10),

Lastname varchar(10),

sal float,

Department varchar(10)

)

Found interesting? Add this to:


>> Write Response - Respond to this post and get points

More codes snippets

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 6/19/2013 2:23:35 PM