SQL Server Query to copy database table and place it in the same database
Option 1 : Copy database table through SQL Query
SQL Server Query to copy database table and place it in the same database
SELECT *
INTO New_Table
FROM Old_Table;
Option 1 : Copy database table through SQL Query
This query will create and copy the same table duplicate in database with data available in Existing table.
This query will create and copy the same table duplicate in database without existing data.
SELECT *
INTO New_Table
FROM Old_Table
WHERE 1 <> 1;
Option 2 : Copy Schema-Generate DDL through SSMS UI
In SSMS expand your database in Object Explorer, Go to Tables, right click on the table you want to copy. Select Script Table As, Create To, New Query Editor Window.
Do a find and replace (CTRL + H) to change the table name (i.e. put Old_Table in the Find What field and New_Table in the Replace With then click OK).
Happy Learning !!!!!!
메타데이터
- post_id
- 499e050418c4
- slug
- sql-server-query-to-copy-database-table-and-place-it-in-the-same-database-499e050418c4
- url
- https://medium.com/@dhivyamathi23/sql-server-query-to-copy-database-table-and-place-it-in-the-same-database-499e050418c4
- canonical_url
- https://medium.com/@dhivyamathi23/sql-server-query-to-copy-database-table-and-place-it-in-the-same-database-499e050418c4
- author_url
- https://medium.com/@dhivyamathi23
- status
- ok
- fetched_at
- 2026-07-14 17:06:34