Click here to Skip to main content
13,253,118 members (49,508 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


1 bookmarked
Posted 16 Dec 2011

Copy paste complete Table SQL Server

, 16 Dec 2011
Rate this:
Please Sign up or sign in to vote.
Using a very simple query we can make replica of existing table along with full data and datatypes
There is a pretty nice method available to transfer data from one table to another

Transfer data from existing table to new table:
select * into table2 from table1

Copy all data from table1 into table2 (it creates new table2 no need to write create statement)

It will create new table2 and transfer all data from table1 to table2

Transfer data from existing table1 to existing table2:

If you want to transfer data from one table to existing table2 then use
Insert into vt_FE_Role1
Select [Role] from vt_FE_Role

Do not include primary key column if it is set as identity. Otherwise you can use it.
You must take care of RDBMS if exists.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Technical Lead
Pakistan Pakistan
This member doesn't quite have enough reputation to be able to display their biography and homepage.

You may also be interested in...


Comments and Discussions

GeneralReason for my vote of 1 sql basics not tip Pin
Selvin17-Dec-11 5:23
memberSelvin17-Dec-11 5:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.171114.1 | Last Updated 16 Dec 2011
Article Copyright 2011 by umairaslam22
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid