Description
Cross-reference table mapping products to related product documents.
Table properties
| name | value |
|---|
| name | [Production].[ProductDocument] |
| created | Mar 19 2009 9:08PM |
| modified | Mar 19 2009 9:08PM
|
| ansi nulls | on
|
| quoted identifier | on
|
| row count | 32 |
| Size of data | 8 kb |
| Size of indexes | 8 kb |
| Maximum size of a single row | 16 bytes |
Columns
| column | datatype | length | bytes | default | nulls | PK | FK | UQ | computed | comment |
|---|
| ProductID | int | 10 | 4 | | no
| composite PK
| Product.ProductID
|
| no
| Product identification number. Foreign key to Product.ProductID.
|
| DocumentID | int | 10 | 4 | | no
| composite PK
| Document.DocumentID
|
| no
| Document identification number. Foreign key to Document.DocumentID.
|
| ModifiedDate | datetime | 23 | 8 | (getdate()) | no
|
| |
| no
| Date and time the record was last updated.
|
Indexes
References
Foreign key graph
Foreign keys
| name | columns | foreign columns | type | comment |
|---|
| FK_ProductDocument_Document_DocumentID | DocumentID | Document.DocumentID |
| Foreign key constraint referencing Document.DocumentID.
|
| FK_ProductDocument_Product_ProductID | ProductID | Product.ProductID |
| Foreign key constraint referencing Product.ProductID.
|
Defaults
Dependency graph
Sample rows
| ProductID | DocumentID | ModifiedDate |
|---|
| 317
| 1
| 1/30/2004 1:51:58 PM
|
| 318
| 1
| 1/30/2004 1:51:58 PM
|
| 319
| 1
| 1/30/2004 1:51:58 PM
|
| 506
| 2
| 1/30/2004 1:51:58 PM
|
| 506
| 3
| 1/30/2004 1:51:58 PM
|
| 514
| 8
| 1/30/2004 1:51:58 PM
|
| 515
| 8
| 1/30/2004 1:51:58 PM
|
| 516
| 8
| 1/30/2004 1:51:58 PM
|
| 517
| 8
| 1/30/2004 1:51:58 PM
|
| 518
| 8
| 1/30/2004 1:51:58 PM
|
Code
CREATE TABLE [Production].[ProductDocument](
[ProductID] [int] NOT NULL,
[DocumentID] [int] NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_ProductDocument_ProductID_DocumentID] PRIMARY KEY CLUSTERED
(
[ProductID] ASC,
[DocumentID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
ALTER TABLE [Production].[ProductDocument] WITH CHECK ADD CONSTRAINT [FK_ProductDocument_Document_DocumentID] FOREIGN KEY([DocumentID])
REFERENCES [Production].[Document] ([DocumentID])
ALTER TABLE [Production].[ProductDocument] CHECK CONSTRAINT [FK_ProductDocument_Document_DocumentID]
ALTER TABLE [Production].[ProductDocument] WITH CHECK ADD CONSTRAINT [FK_ProductDocument_Product_ProductID] FOREIGN KEY([ProductID])
REFERENCES [Production].[Product] ([ProductID])
ALTER TABLE [Production].[ProductDocument] CHECK CONSTRAINT [FK_ProductDocument_Product_ProductID]
ALTER TABLE [Production].[ProductDocument] ADD CONSTRAINT [DF_ProductDocument_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]