Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
can anyone give me a sample code or link of how to insert multiple rows in a table using stored procedure
Posted
Updated 9-Feb-12 2:13am
v2

Hi,
use a select...
SQL
INSERT INTO T1 (FirstName,...)
    SELECT FirstName, LastName... FROM T2;
 
Share this answer
 
v2
Try this

SQL
create proc Ins_TableData
as
  insert into DestinationTable(col0, col1)
  select col0, col1 from sourceTable

Go
 
Share this answer
 
v2
Comments
Nihal Hussain 9-Feb-12 23:24pm    
is it possible to in insert multiple rows at a time in a table using this query?? i dont want to use other tables
sachin10d 13-Feb-12 0:36am    
yes, It is possible

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900