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

post comment
     
COMMENT USING
PREMIUM SPONSORS
DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.
Join a Chapter
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
Get Career Advice from Experts