Transfer Data from One Table to Another

By Nitesh Singhal Mar 14, 2013
Mostly developers need to transfer data from one table to another. For this purpose we have two scenarios.

Mostly developers need to transfer data from one table to another. For this purpose we have two scenarios :

One target table is already created. second target table is not already created

So in first scenario when Target table is already created.

we can use following command :

INSERT INTO TargetTable (FirstName, LastName)

SELECT FirstName, LastName

FROM sourceTable

WHERE age = 21

So in first scenario when Target table is not already created.

SELECT FirstName, LastName

INTO TargetTable

FROM sourceTable

WHERE age = 21

COMMENT USING

PREMIUM SPONSORS

Hire Mobile & Web Developer on demand. 100% satisfaction. Try for 1 week or Money Back. Local and remote developers available all over USA.

Latest Blogs