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

Answer Posted / dhiraj kumar

we have to use INSERT INTO method.
with the use of this method we can easily transfer records
from one table to another table but both table should have
similar columns or you need to select same no of columns
and datatype as inserting table

example:table A1 having 2 columns emp_name,emp_address
and A2 having 4 column name,address,city,dept

INSERT INTO A1 select name,address from A2.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to choose all records from the table?

805


In my application I have a process which picks the scanned files (tif format) from a shared location and it links to application and shown on it.The actuall issue is that my process picks the file before it is completly written or scanned which results in displaying few parts of the image or incomplete image.I need to check if the file is not completly scanned or written then do not link it to application.Please help if any body tell me that how can i check that file is in written phase or locked through DTS.thanking you in advance

1726


Differentiate sql server reporting services vs. Crystal reports?

168


Explain difference between control flow and data flow?

719


What is t-sql script to take database offline – take database online.

797


Tell me what do we need queues in sql service broker?

711


What is the dbcc command and why is it used?

767


How to write character string constants or literals in ms sql server?

763


Explain what is use of dbcc commands?

711


Is it possible in sql table to have more than one foreign key?

789


Explain a checkpoint?

771


What is sql view?

739


Write a SQL query in order to merge two different columns into single column?

811


Explain atomicity?

732


How to return the top 5 rows from a select query in ms sql server?

785