Blog

Transfer Data from One Table to Another

Posted by Nitesh Singhal Blogs | SQL 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
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.
SPONSORED BY
  • MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.