Hello,
I need to copy a mass amount of tables in SQL Server to the same database (obviously renaming the tables). I need to include constraints, keys, indexes, etc, as well as data.
So for example:
ACGPTL_Affiliates => AFPPTL_Affiliates
(we need to copy an old dot net nuke site, and our host is limited to one database)
First thought was just 'SELECT * INTO (new table) FROM (old table)', but this would just be data only, correct?
Second thought was using the 'Script Table As -> Create To' task. The output of this looks like what I want. The problem is I couldn't recreate the data properly, right? Or am I wrong? My feeling was if I just followed this with a 'SELECT * INTO (new table) FROM (old table)' I would be screwed due to the PK and constraints being missed.
Any thoughts? Is there a supported way to do this? I have access to intermediate databases, but ultimately both tables need to reside in a single database.
Thanks~
I need to copy a mass amount of tables in SQL Server to the same database (obviously renaming the tables). I need to include constraints, keys, indexes, etc, as well as data.
So for example:
ACGPTL_Affiliates => AFPPTL_Affiliates
(we need to copy an old dot net nuke site, and our host is limited to one database)
First thought was just 'SELECT * INTO (new table) FROM (old table)', but this would just be data only, correct?
Second thought was using the 'Script Table As -> Create To' task. The output of this looks like what I want. The problem is I couldn't recreate the data properly, right? Or am I wrong? My feeling was if I just followed this with a 'SELECT * INTO (new table) FROM (old table)' I would be screwed due to the PK and constraints being missed.
Any thoughts? Is there a supported way to do this? I have access to intermediate databases, but ultimately both tables need to reside in a single database.
Thanks~