I would like to make a copy of an existing table. We can
use the following statement:
SELECT * INTO new_table from old_table
However, someone says that the constraint and indexes are
not copied across.
If I copy the table with DTS, does it copy both
constraints and indexes ?
ThanksDTS will not create the indexes either.
You will need to script the copy and create new indexes.
Immy
"Peter" <anonymous@.discussions.microsoft.com> wrote in message
news:04f501c46e27$1a640940$a301280a@.phx.gbl...
> I would like to make a copy of an existing table. We can
> use the following statement:
> SELECT * INTO new_table from old_table
> However, someone says that the constraint and indexes are
> not copied across.
> If I copy the table with DTS, does it copy both
> constraints and indexes ?
> Thanks|||Hi,
SELECT * INTO , DTS will not copy the dependant objects. The only solution
is to create the scripts using "Generate SQL Script" using Enterprise
manager by selecting all dependant objects. AFter generating the script
change the object names and execute in Query Analyzer. After the object
creation use
INSERT into new_table_name select * from existing_table
Thanks
Hari
MCDBA
"Peter" <anonymous@.discussions.microsoft.com> wrote in message
news:04f501c46e27$1a640940$a301280a@.phx.gbl...
> I would like to make a copy of an existing table. We can
> use the following statement:
> SELECT * INTO new_table from old_table
> However, someone says that the constraint and indexes are
> not copied across.
> If I copy the table with DTS, does it copy both
> constraints and indexes ?
> Thanks
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment