Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

duplicating a table in SQL server 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

What's the quickest way to duplicate a table in Microsoft SQL 7.0.

Can you duplicate the structure and the data

or

just the structure

cheers

Mark
 
DTS for structure and data and generate script, change table name, execution of new script if you want only to duplicate the structure.
 
Hi Mark,

The quickest way to duplicate a structure with no data is :

SELECT *
INTO new_table
FROM old_table
WHERE 1=2

The where clause will ensure that no data is populated, but you will end up with a mirror image table.

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top