Production |
04/26/2006 |
PRIMARY |
6304 |
2992 |
113443 |
Record of each purchase order, sales order, or work order transaction year to date. |
|
|
TransactionID |
int |
4 |
|
|
|
|
Primary key for TransactionHistory records. |
|
|
ProductID |
int |
4 |
|
|
|
|
Product identification number. Foreign key to Product.ProductID. |
|
|
ReferenceOrderID |
int |
4 |
|
|
|
|
Purchase order, sales order, or work order identification number. |
|
|
ReferenceOrderLineID |
int |
4 |
|
((0)) |
|
|
Line number associated with the purchase order, sales order, or work order. |
|
|
TransactionDate |
datetime |
8 |
|
(getdate()) |
|
|
Date and time of the transaction. |
|
|
TransactionType |
nchar |
1 |
|
|
|
|
W = WorkOrder, S = SalesOrder, P = PurchaseOrder |
|
|
Quantity |
int |
4 |
|
|
|
|
Product quantity. |
|
|
ActualCost |
money |
8 |
|
|
|
|
Product cost. |
|
|
ModifiedDate |
datetime |
8 |
|
(getdate()) |
|
|
Date and time the record was last updated. |
Total: 9 column(s)
|
TransactionID |
100000 |
1 |
|
Total: 3 index(es)
|
CK_TransactionHistory_TransactionType |
(upper([TransactionType])='P' OR upper([TransactionType])='S' OR upper([TransactionType])='W') |
Total: 1 constraint(s)
Total: 1 table(s)
Total: 7 object(s)
Total: 5 object(s)
CREATE TABLE [TransactionHistory] (
[TransactionID] [int] IDENTITY (100000, 1) NOT NULL ,
[ProductID] [int] NOT NULL ,
[ReferenceOrderID] [int] NOT NULL ,
[ReferenceOrderLineID] [int] NOT NULL CONSTRAINT [DF_TransactionHistory_ReferenceOrderLineID] DEFAULT ((0)),
[TransactionDate] [datetime] NOT NULL CONSTRAINT [DF_TransactionHistory_TransactionDate] DEFAULT (getdate()),
[TransactionType] [nchar] (1) COLLATE Latin1_General_CS_AS NOT NULL ,
[Quantity] [int] NOT NULL ,
[ActualCost] [money] NOT NULL ,
[ModifiedDate] [datetime] NOT NULL CONSTRAINT [DF_TransactionHistory_ModifiedDate] DEFAULT (getdate()),
CONSTRAINT [PK_TransactionHistory_TransactionID] PRIMARY KEY CLUSTERED
(
[TransactionID]
) ON [PRIMARY] ,
CONSTRAINT [FK_TransactionHistory_Product_ProductID] FOREIGN KEY
(
[ProductID]
) REFERENCES [Product] (
[ProductID]
),
CONSTRAINT [CK_TransactionHistory_TransactionType] CHECK (upper([TransactionType])='P' OR upper([TransactionType])='S' OR upper([TransactionType])='W')
) ON [PRIMARY]
GO
List of tables