Description
Cross-reference table mapping products to related product documents.
Table properties
| name | value |
|---|
| name | [Production].[ProductDocument] |
| created | Mar 19 2009 9:09PM |
| modified | Mar 19 2009 9:10PM
|
| 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 | NaN 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.
|
| DocumentNode | hierarchyid | 892 | variable | | no
| composite PK
| Document.DocumentNode
|
| no
| Document identification number. Foreign key to Document.DocumentNode.
|
| 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_Product_ProductID | ProductID | Product.ProductID |
| Foreign key constraint referencing Product.ProductID.
|
| FK_ProductDocument_Document_DocumentNode | DocumentNode | Document.DocumentNode |
| Foreign key constraint referencing Document.DocumentNode.
|
Defaults
Dependency graph
Sample rows
| ProductID | DocumentNode | ModifiedDate |
|---|
| 317
| /2/1/
| 1/30/2004 1:51:58 PM
|
| 318
| /2/1/
| 1/30/2004 1:51:58 PM
|
| 319
| /2/1/
| 1/30/2004 1:51:58 PM
|
| 506
| /3/1/
| 1/30/2004 1:51:58 PM
|
| 506
| /3/2/
| 1/30/2004 1:51:58 PM
|
| 514
| /3/4/
| 1/30/2004 1:51:58 PM
|
| 515
| /3/4/
| 1/30/2004 1:51:58 PM
|
| 516
| /3/4/
| 1/30/2004 1:51:58 PM
|
| 517
| /3/4/
| 1/30/2004 1:51:58 PM
|
| 518
| /3/4/
| 1/30/2004 1:51:58 PM
|
Code
CREATE TABLE [Production].[ProductDocument](
[ProductID] [int] NOT NULL,
[DocumentNode] [hierarchyid] NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_ProductDocument_ProductID_DocumentNode] PRIMARY KEY CLUSTERED
(
[ProductID] ASC,
[DocumentNode] 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_DocumentNode] FOREIGN KEY([DocumentNode])
REFERENCES [Production].[Document] ([DocumentNode])
ALTER TABLE [Production].[ProductDocument] CHECK CONSTRAINT [FK_ProductDocument_Document_DocumentNode]
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]