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

Is sql server difficult to learn?

525


What is indexed view?

601


Is it possible to run multiple publications and different type of publications from the same distribution database? : sql server replication

575


How to create prepared statements using odbc_prepare()?

568


What is user defined stored procedures?

568






i have made a project i vb.net n created a .exe of it after installing it in to any pc, the database (sql express) is not geting accesed i.e the aplication cuts the link of the database, so plz help in this matter.

1376


How to use copy and concatenate commands in SQL?

601


What is sql collation?

655


How does a profiler work?

519


How to connect ms access to sql servers through odbc?

555


You have a table ‘test’ which is a copy of northwind employee table you have written a trigger to update the field ‘hiredate’ with the current date

602


Can you explain what are commit and rollback in sql?

491


What is difference between aggregate and analytic function?

483


How to use linked server?

593


Do you know the cursor optimization tips?

590