Thursday, June 25, 2009

Multiple Insertion SQL


Inserting multiple records in MS SQLServer/MySQL

In Ms SQL Server you can insert multiple records using one insert statement

Field
Data Type
id
int
name
varchar(50)

INSERT INTO student (id,name)
SELECT 100,'Anu'
UNION
SELECT 101,'Rahul'
UNION
SELECT 102,'Vinu'

In MySQL you can insert multiple records using one insert statement

INSERT INTO student (id,name) VALUES (101,'Anu'),(102,'Rahul'),(103,'Vinu');

0 comments:

 
 
 
 
 

My Blog List

IT HIGHWAY © 2008 Business Ads Ready is Designed by Ipiet Supported by Tadpole's Notez