Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 29th, 2006, 10:51 PM
Registered User
 
Join Date: Oct 2006
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
)

 
Old December 2nd, 2006, 02:02 PM
Friend of Wrox
 
Join Date: Jun 2003
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





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 12:16 AM
Conflict in SQL Server 2000 and SQL Server 2005 ayan.mukherjee SQL Language 0 June 30th, 2008 03:34 AM
Book: Professional SQL Server 2005 CLR Programming VictorVictor SQL Server 2005 0 April 7th, 2008 04:47 PM
Source code for "Beginning SQL programming" docker Wrox Book Feedback 12 June 6th, 2007 10:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.