• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 291
  • 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
0
frosty1
Asked:
frosty1
1 Solution
 
JestersGrindCommented:
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.

Greg

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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