I want to know how to create duplicate table from table stored in database in SQL Server.
Thank you.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pankajkumar PatelPosted Nov 16, 2021, 2:43 PM
Hi Vipendra Verma,
There are two ways to create duplicate table from table stored in database in SQL Server:
For more details:
Hope, this will help you!
Vinitha TPosted Nov 16, 2021, 1:47 PM
Santhosh Kumar JayaramanPosted Jun 27, 2012, 8:05 AM
you can create using the below query
select * into teamsnew from teamsold.
Here teamsold-existing table and teamsnew-new one to be created.
But remember it will copy the columns and rows but keys and constraints wont be copied. Best way to achieve this is get table creation script from db and rename the table and keys, constraints name and run it,.
Satyapriya NayakPosted Jun 27, 2012, 8:02 AM
If we want to copy the structure only
SELECT TOP 0 * INTO newtable FROM oldtable
SELECT TOP 0 * INTO employee1 FROM employee
If we want to copy the structure as well as records
select * into newtable from oldtable
SELECT *
INTO employee1
FROM employee
Thanks