Amazon Ad

Sunday 28 July 2013

Copy data of one table into another table in MS SQL

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

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

How to implement Captcha v3 in ASP.NET

 I was facing an issue of dom parsing in my website. I finally resolved it by using Google Captcha V3. Step 1: Get your keys from https:...