Owner: | Production |
Creation Date: | 04/26/2006 |
Located On: | PRIMARY |
Data Size KB: | 16 |
Index Size KB: | 40 |
Rows: | 504 |
Description: | Cross-reference table mapping products and product photos. |
Name | Data Type | Length | NULL | Default | IsIdentity | IsGUID | Description | ||
ProductID | int | 4 | Product identification number. Foreign key to Product.ProductID. | ||||||
ProductPhotoID | int | 4 | Product photo identification number. Foreign key to ProductPhoto.ProductPhotoID. | ||||||
Primary | Flag | 1 | ((0)) | 0 = Photo is not the principal image. 1 = Photo is the principal image. | |||||
ModifiedDate | datetime | 8 | (getdate()) | Date and time the record was last updated. |
Index | Primary | Unique | Description | |
PK_ProductProductPhoto_ProductID_ProductPhotoID | Primary key (clustered) constraint |
Table | Foreign Key | Primary Key or Unique Constraint | |
Production.Product | FK_ProductProductPhoto_Product_ProductID | PK_Product_ProductID | |
Production.ProductPhoto | FK_ProductProductPhoto_ProductPhoto_ProductPhotoID | PK_ProductPhoto_ProductPhotoID |
Objects that [Production].[ProductProductPhoto] depends on
Object Name | Owner | Object Type | Dep Level | |
Flag | dbo | User Defined type | 1 | |
Name | dbo | User Defined type | 1 | |
ProductCategory | Production | Table | 2 | |
ProductModel | Production | Table | 2 | |
ProductPhoto | Production | Table | 2 | |
UnitMeasure | Production | Table | 2 | |
ProductSubcategory | Production | Table | 3 | |
Product | Production | Table | 4 |
CREATE TABLE [ProductProductPhoto] (
[ProductID] [int] NOT NULL ,
[ProductPhotoID] [int] NOT NULL ,
[Primary] [Flag] NOT NULL CONSTRAINT [DF_ProductProductPhoto_Primary] DEFAULT ((0)),
[ModifiedDate] [datetime] NOT NULL CONSTRAINT [DF_ProductProductPhoto_ModifiedDate] DEFAULT (getdate()),
CONSTRAINT [PK_ProductProductPhoto_ProductID_ProductPhotoID] PRIMARY KEY NONCLUSTERED
(
[ProductID],
[ProductPhotoID]
) ON [PRIMARY] ,
CONSTRAINT [FK_ProductProductPhoto_Product_ProductID] FOREIGN KEY
(
[ProductID]
) REFERENCES [Product] (
[ProductID]
),
CONSTRAINT [FK_ProductProductPhoto_ProductPhoto_ProductPhotoID] FOREIGN KEY
(
[ProductPhotoID]
) REFERENCES [ProductPhoto] (
[ProductPhotoID]
)
) ON [PRIMARY]
GO
See Also
List of tables