Prepare for your Next Interview
This is a discussion on copy the Table Structure within the SQL Server forums, part of the Databases category; Hi I want to copy the structure & all constrains of one table into other table. There is any Direct query is there without using Sql Scirpt???...
|
|||
|
copy the Table Structure
Hi
I want to copy the structure & all constrains of one table into other table. There is any Direct query is there without using Sql Scirpt??? |
| Sponsored Links |
|
|||
|
Re: copy the Table Structure
You have a function called as copy function in SQL server which you can use to copy the structure and all constrains of one table into other table. If you want to make a clone of the same table with structure, constraints and data you can make use of clone function available with SQL server.
|
|
|||
|
Re: copy the Table Structure
Using INTO we can copy..
SELECT TOP 0 * INTO New_Table_Name From Old_Table_Name The Above query will come only the structure for the table.. If U want to copy with the data then remove the "Top 0 ".. SELECT * INTO New_Table_Name FROM Old_Table_Name |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Query to find structure of a table | Geek_Guest | SQL | 12 | 09-01-2008 11:12 PM |
| Creating a table by copying another table's structure | Allan Paul | Oracle | 12 | 07-12-2007 07:53 AM |
| How a java table be brought to data table? | dhandhan | QTP | 0 | 04-15-2007 06:14 AM |
| Silent Copy - copy your files with the convenience! | JobHelper | Geeks Lounge | 0 | 04-05-2007 04:40 AM |
| Deep copy | janelyn | ASP.NET | 1 | 08-03-2006 02:18 PM |