Click here to Skip to main content
15,895,772 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
how can i make a query for inserting existing data for another table ?
Posted

use this--
SQL
insert into desttable (listofcolumns) select listofcolumn from sourcetable


--Pankaj
 
Share this answer
 
Comments
Pravin Patil, Mumbai 8-Mar-11 7:54am    
This query makes more sense..
Take my 5....
select * into [database_name].[dbo].[table_name] from [database_name].[dbo].[table_name]
 
Share this answer
 
Comments
Pravin Patil, Mumbai 8-Mar-11 7:55am    
Another good solution..
only the thing is it will create new table....
My 5...

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