| Primary Key | Field Type |
|---|---|
ID |
uniqueidentifier |
| Field | Field Type | Null | Notes | Description |
|---|---|---|---|---|
LOOKUPCODE |
nvarchar(25) | Default = '' | An alternate lookup code that can be a sku, upc, etc... | |
COST |
money | Default = 0 | The cost of the item when purchased from the vendor. | |
SALEPRICE |
money | Default = 0 | The price at which the product is sold to patrons. | |
MARKUP |
money (Computed) | ![]() |
SALEPRICE-COST | The difference between price and cost. |
DATEADDED |
datetime | Default = getdate() | Indicates the date this record was added. | |
DATECHANGED |
datetime | Default = getdate() | Indicates the date this record was last changed. | |
TS |
timestamp | Timestamp. | ||
TSLONG |
bigint (Computed) | ![]() |
CONVERT(bigint, TS) | Numeric representation of the timestamp. |
ONHANDQUANTITY |
int | Default = 0 | The on hand quantity for the product instance. | |
ISACTIVE |
bit | Default = 1 | The active status of the product instance. | |
CUSTOMIDENTIFIER |
nvarchar(100) | Default = '' | User-definable custom identifier. | |
SEQUENCEID |
int | Identity column used to increment the default lookupid. | ||
LOOKUPID |
nvarchar(100) (Computed) | ![]() |
(CASE LEN(CUSTOMIDENTIFIER) WHEN 0 THEN '8-' + CAST(SEQUENCEID AS nvarchar(20)) ELSE CUSTOMIDENTIFIER END) | Unique identifer that supports user defined values as well as system generated values. |
BARCODE |
nvarchar(24) (Computed) | ![]() |
'SKU0' + cast(SEQUENCEID as nvarchar(20)) | Stores the unique system generated barcode for a product instance. |
ITEMDETAILS |
nvarchar(150) (Computed) | ![]() |
dbo.UFN_MERCHANDISEPRODUCTINSTANCE_BUILDDESCRIPTION(ID) |
| Foreign Key | Field Type | Null | Notes | Description |
|---|---|---|---|---|
MERCHANDISEPRODUCTID |
uniqueidentifier | MERCHANDISEPRODUCT.ID | The product from which the instance is created. | |
ADDEDBYID |
uniqueidentifier | CHANGEAGENT.ID | FK to CHANGEAGENT. | |
CHANGEDBYID |
uniqueidentifier | CHANGEAGENT.ID | FK to CHANGEAGENT. |
| Index Name | Field(s) | Unique | Primary | Clustered |
|---|---|---|---|---|
IX_MERCHANDISEPRODUCTINSTANCE_DATEADDED |
DATEADDED | ![]() |
||
IX_MERCHANDISEPRODUCTINSTANCE_DATECHANGED |
DATECHANGED | |||
PK_MERCHANDISEPRODUCTINSTANCE |
ID | ![]() |
![]() |
|
UC_MERCHANDISEPRODUCTINSTANCE_LOOKUPID |
LOOKUPID | ![]() |
||
UIX_MERCHANDISEPRODUCTINSTANCE_BARCODE |
BARCODE | ![]() |
| Trigger Name | Description |
|---|---|
TR_MERCHANDISEPRODUCTINSTANCE_AUDIT_UPDATE |
|
TR_MERCHANDISEPRODUCTINSTANCE_AUDIT_DELETE |
| Referenced by | Field |
|---|---|
MERCHANDISEPRODUCTINSTANCEOPTIONVALUE |
MERCHANDISEPRODUCTINSTANCEID |
MERCHANDISEPRODUCTLABLEPRINTHISTORY |
MERCHANDISEPRODUCTINSTANCEID |
REVENUESPLITORDER |
MERCHANDISEPRODUCTINSTANCEID |
SALESORDERITEMMERCHANDISE |
MERCHANDISEPRODUCTINSTANCEID |

ID
LOOKUPCODE
MARKUP
MERCHANDISEPRODUCTID
IX_MERCHANDISEPRODUCTINSTANCE_DATEADDED
IX_MERCHANDISEPRODUCTINSTANCE_DATECHANGED