Hi Folks,
Today i am going to tell you how to copy data of one table into another table. There are basically conditions for this
1. Destination table (The table which would have the new data) exists in the database
2. Destination table (The table which would have the new data) does not exists in the database
For both these conditions seperate MS SQL commands are used.
1.When the table doesn't exists and the data is to be fetched from a temporary table.
select * into [tablename] from #[temptablename]
2. When the table exists in the database and the data is to be fetched from a temporary table.
insert into [tablename]
select * from #[temptablename]
Thanks
Ritesh
Today i am going to tell you how to copy data of one table into another table. There are basically conditions for this
1. Destination table (The table which would have the new data) exists in the database
2. Destination table (The table which would have the new data) does not exists in the database
For both these conditions seperate MS SQL commands are used.
1.When the table doesn't exists and the data is to be fetched from a temporary table.
select * into [tablename] from #[temptablename]
2. When the table exists in the database and the data is to be fetched from a temporary table.
insert into [tablename]
select * from #[temptablename]
Thanks
Ritesh
No comments:
Post a Comment
Comments are welcome, Please join me on my Linked In account
http://in.linkedin.com/pub/ritesh-tandon/21/644/33b