Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Forum and Wrox.com Feedback Post your suggestions for improving the Forums or Wrox.com or questions for the staff here. "Where can I find the code for my book?"
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Forum and Wrox.com Feedback 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
Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 31st, 2013, 01:39 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default primary n foreign key

I have 2 tables job order n estimate.............. job order is a primary key in its table

n estimate table include job order but in estimate table estimate order is the primary key so how estimate table job order can auto generate same as in job order table


CREATE TABLE [dbo].[Job_Order](
[JobNumber] [varchar](30) NOT NULL,
[Department] [nchar](30) NULL,
[Budget] [money] NOT NULL,
[Description] [nchar](200) NULL,
[FilledBy] [nchar](30) NOT NULL,
[Date] [date] NOT NULL,
CONSTRAINT [PK_Job_Order] PRIMARY KEY CLUSTERED
(
[JobNumber] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


CREATE TABLE [dbo].[Estimate](
[JobNumber] [varchar](30) NOT NULL,
[EstimateNumber] [varchar](30) NOT NULL,
[Description] [varchar](200) NOT NULL,
[Amount] [money] NOT NULL,
[AmountInWords] [varchar](100) NOT NULL,
[date] [date] NOT NULL,
CONSTRAINT [PK_Estimate] PRIMARY KEY CLUSTERED
(
[EstimateNumber] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO
Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
SQL Design: Foreign Key to Multiple Primary Keys? kalel_4444 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 10 May 8th, 2008 04:14 PM
Foreign key not updating with Primary key xavier1945 BOOK: Access 2003 VBA Programmer's Reference 2 July 4th, 2007 09:48 PM
inserting records with foreign and primary keys tdaustin Classic ASP Basics 0 October 4th, 2005 12:49 AM
FOREIGN KEY and PRIMARY KEY Constraints junemo Oracle 10 June 15th, 2004 01:00 AM



All times are GMT -4. The time now is 05:55 PM.


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