26.4.09

Inserting multiple records using single insert statement

An Interesting topic with Insert statement,
Is it possible to insert multiple records using one single insert statement.
Let's see,
-- If table exists, drop the table
drop table venkat
create table venkat(id int, name varchar(10))
insert into venkat
select 1,'Venkat'
union all
select 2,'arun'
union all
select 3,'Lakshmi'
union all
select 4,'arun'
union all
select 5,'ve'
select * from venkat

Thanks and Regards,
Venkatesan Prabu .J

No comments:

Post a Comment