How to a Query to copy data from on table to another table.

Answer Posted / mohamed ibrahim

To Copy the data from one table to another table
for ex . i have the table named as TempMaster that having
the fields ID ,Name .The having the following record
ID Name
1 Raja
2 Mohamed

I want the same record copy to TempMasterArcheived table

to copy this using the following code:
INSERT INTO TempMasterArcheived
EXECUTE
('SELECT * FROM TempMaster ')

ID Name
1 Raja
2 Mohamed

after the output of TempMasterArcheived is as follows

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between report and query parameter.

594


What is the difference between an index and a unique index?

544


What are the elements of dbms?

539


How to provide default values to stored procedure parameters?

570


Do you know sql server 2008 introduces automatic auditing?

512






what is normalization? Explain different levels of normalization? : Sql server database administration

645


How would you use user_constraints table in DB?

586


What is the contrast amongst drop and truncate?

552


What is cursors? And what are the different types of cursor?

553


What is openrowset sql server?

517


what are the different types of replication you can set up in sql server? : Sql server database administration

510


Suggest a method of joining two tables.

598


When would you use it?

574


What is sleeping status in sql server?

516


What are the methods used to protect against sql injection attack?

563