Solved

How to copy 2 foreign key tables in mssql 2008

Posted on 2011-09-07
1
238 Views
Last Modified: 2012-05-12
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
Comment
Question by:frosty1
1 Comment
 
LVL 21

Accepted Solution

by:
JestersGrind earned 500 total points
ID: 36495074
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SQL Server Log File Space 6 33
Updating variable table 9 17
SQl query 19 12
Calculating Business Hours 19 62
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now