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

What are the advantages of user-defined functions over stored procedures in sql server?

455


Explain linked server in sql?

686


What are data resources?

498


What does it mean to be in union?

512


How is sql used in sql server?

493






Explain system scalar functions?

569


How to how to convert numeric expression data types using the convert() function??

539


How to delete an existing database user?

524


What is dknf in normalization form?

551


What is the difference between a function and a trigger?

563


Give an example of why you would want to denormalize a database

505


how many triggers you can have on a table? : Sql server database administration

486


1.what is the diff between nolock optimizer and read uncommitted isolation? 2.what is the diff between revoke and deny? 3.what is percieved down time? 4.whether password protection are required for backups?if yes why?if no why? 5.what is fill factor? 6.what is cost analysis? 7.what is mean by piece meal restore? 8.what is 'rowguidcol'? 9.impersonate permission? 10.what is selectivity?

1620


What is the difference between system objects and user objects?

699


Write a program to fetch first 10 records from a file?

596