MEMBERSHIPCARD
Stores membership card data for members.
Primary Key
| Primary Key |
Field Type |
| ID |
uniqueidentifier |
Fields
| Field |
Field Type |
Null |
Notes |
Description |
| NAMEONCARD |
nvarchar(700) |
|
Default = '' |
The name to use on the card. |
| CARDNUMBER |
nvarchar(100) |
|
Default = '' |
The number of the membership card. |
| EXPIRATIONDATE |
datetime |
yes |
|
The expiration date of the membership card. |
| STATUSCODE |
tinyint |
|
Default = 0 |
The status of the card: 0 - Issued, 1 - Printed, 2 - Cancelled. |
| PRINTDATE |
datetime |
yes |
|
The date the card was printed. |
| COMMENTS |
nvarchar(1000) |
|
Default = '' |
Remarks about this membership card. |
| 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) |
yes |
CONVERT(bigint, TS) |
Numeric representation of the timestamp. |
| STATUS |
nvarchar(9) (Computed) |
yes |
CASE [STATUSCODE] WHEN 0 THEN N'Issued' WHEN 1 THEN N'Printed' WHEN 2 THEN N'Cancelled' END |
Provides a translation for the 'STATUSCODE' field. |
Foreign Keys
| Foreign Key |
Field Type |
Null |
Notes |
Description |
| MEMBERID |
uniqueidentifier |
|
MEMBER.ID
|
FK to MEMBER |
| PRINTEDBYID |
uniqueidentifier |
yes |
CHANGEAGENT.ID
|
The change agent that printed the card. |
| ADDEDBYID |
uniqueidentifier |
|
CHANGEAGENT.ID
|
FK to CHANGEAGENT. |
| CHANGEDBYID |
uniqueidentifier |
|
CHANGEAGENT.ID
|
FK to CHANGEAGENT. |
| PRINTMEMBERSHIPCARDSPROCESSSTATUSID |
uniqueidentifier |
yes |
PRINTMEMBERSHIPCARDSPROCESSSTATUS.ID
|
Foreign key to the process status that printed the card. |
Indexes
| Index Name |
Fields |
Unique |
Primary |
Clustered |
| IX_MEMBERSHIPCARD_CARDNUMBER |
CARDNUMBER |
|
|
|
| IX_MEMBERSHIPCARD_DATEADDED |
DATEADDED |
|
|
yes |
| IX_MEMBERSHIPCARD_DATECHANGED |
DATECHANGED |
|
|
|
| IX_MEMBERSHIPCARD_MEMBERID |
MEMBERID |
|
|
|
| PK_MEMBERSHIPCARD |
ID |
yes |
yes |
|
Triggers
Referenced by