anonymous
anonymous

Reputation: 6885

SQL Server - Create Copy of Multiple Tables in Same Database

I need to duplicate several tables in a single database. Basically we have an old dot net nuke portal that needs to be split and our host limits us to a single database. So we just want to take the existing tables but copy them with an exact duplicate but different table prefix name (e.g. EEPTL_Users to JBPTL_Users).

I can use 'script to - create' to make the proper table structure but how do I do the proper inserts when I need to specify the primary keys but want the column to be an auto-incrementing identiy?

Is there a tool for doing what I need?

Upvotes: 1

Views: 837

Answers (1)

ThatSteveGuy
ThatSteveGuy

Reputation: 1095

SET IDENTITY_INSERT [table name] ON

INSERTS

SET IDENTITY_INSERT [table name] OFf

Upvotes: 1

Related Questions