• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 293
  • Last Modified:

How to copy 2 foreign key tables in mssql 2008

I have 2 tables:

- Orders
- OrderItems ( PK on orderId )

How can i copy the both these tables to the follow names and key the PK relationship

- CampaignOrder
- CampaignOrderItems

ie so that i have 4 tables
1 Solution
In Object Explorer, right-click on each table and select Script Table as --> CREATE To --> New Query Editor window.  Then edit the script to change the table names.  Run the scripts.


Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now