Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning SQL Server 2005 Programming ISBN: 978-0-7645-8433-6
This is the forum to discuss the Wrox book Beginning SQL Server 2005 Programming by Robert Vieira; ISBN: 9780764584336
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning SQL Server 2005 Programming ISBN: 978-0-7645-8433-6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 29th, 2006, 10:51 PM
Registered User
 
Join Date: Oct 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Beginning SQL Server 2005 Programming P.162

Should there be only one foreign key in a table? The following code gives two Primary Keys: OrderID, PartNo.

Beginning SQL Server 2005 Programming P.162 (ISBN 0-7645-8433-2):

CREATE TABLE OrderDetails
(
OrderID int not null,
PartNo varchar(10) not null,
Description varchar (25) not null,
UnitPrice money not null,
Qty int not null,
Constraint PKOrderDetails
Primary Key (OrderID, PartNo),
Constraint FKOrderContainsDetails
Foreigh Key (OrderID)
References Orders(OrderID)
On Update No Action
On Delete Cascade
)

Reply With Quote
  #2 (permalink)  
Old December 2nd, 2006, 02:02 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Banbury, , United Kingdom.
Posts: 105
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to DanM
Default

Shawnlo,

There aren't any restrictions on the number of foreign keys in a table save for the number of columns in the table itself.

Dan

Dan Maharry
Read the feed at http://feeds.feedburner.com/dansarchive
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
reg conn to sql server 2005 from vb.net 2005.. veda SQL Server 2005 2 July 1st, 2008 01:16 AM
Conflict in SQL Server 2000 and SQL Server 2005 ayan.mukherjee SQL Language 0 June 30th, 2008 04:34 AM
Book: Professional SQL Server 2005 CLR Programming VictorVictor SQL Server 2005 0 April 7th, 2008 05:47 PM
Source code for "Beginning SQL programming" docker Wrox Book Feedback 12 June 6th, 2007 11:37 PM



All times are GMT -4. The time now is 12:33 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.