PHONE
The PHONE table stores phone numbers associated with a given constituent.
Primary Key
Primary Key |
Field Type |
ID |
uniqueidentifier |
Fields
Field |
Field Type |
Null |
Notes |
Description |
NUMBER |
nvarchar(100) |
|
Default = '' |
Stores the phone number. |
ISPRIMARY |
bit |
|
Default = 0 |
Indicates this phone number is the primary phone number. |
SEQUENCE |
int |
|
Default = 0 |
Stores the user-defined sequence for phone numbers on a constituent. |
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. |
DONOTCALL |
bit |
|
Default = 0 |
Indicates this phone number should not receive phone calls. |
STARTTIME |
UDT_HOURMINUTE |
|
Default = '' |
Time that the phone number becomes valid |
ENDTIME |
UDT_HOURMINUTE |
|
Default = '' |
Time that the phone number becomes no longer valid |
INFOSOURCECOMMENTS |
nvarchar(256) |
|
Default = '' |
Contains additional comments about the information source. |
STARTDATE |
date |
yes |
|
The date the phone number becomes valid. |
ENDDATE |
date |
yes |
|
The date the phone number becomes invalid. |
ISCONFIDENTIAL |
bit |
|
Default = 0 |
Indicates this phone number is confidential. |
ORIGINCODE |
tinyint |
|
Default = 0 |
Defines where the address originated. |
ORIGIN |
nvarchar(9) (Computed) |
yes |
CASE [ORIGINCODE] WHEN 0 THEN N'User' WHEN 1 THEN N'Web Forms' END |
Provides a translation for the 'ORIGINCODE' field. |
SEASONALSTARTDATE |
UDT_MONTHDAY |
|
Default = '0000' |
For seasonal phone types only; DD/MM start date of when this phone should be considered. |
SEASONALENDDATE |
UDT_MONTHDAY |
|
Default = '0000' |
For seasonal phone types only; DD/MM end date of when this phone should be considered. |
NUMBERNOFORMAT |
nvarchar(100) (Computed) |
yes |
dbo.UFN_PHONE_REMOVEFORMATTING(NUMBER) |
Stores a non-formatted version of the number. |
DONOTTEXT |
bit |
|
Default = 0 |
|
Foreign Keys
Foreign Key |
Field Type |
Null |
Notes |
Description |
CONSTITUENTID |
uniqueidentifier |
|
CONSTITUENT.LOCALID
|
FK to CONSTITUENT |
PHONETYPECODEID |
uniqueidentifier |
yes |
PHONETYPECODE.LOCALID
|
FK to PHONETYPECODE |
ADDEDBYID |
uniqueidentifier |
|
CHANGEAGENT.ID
|
FK to CHANGEAGENT. |
CHANGEDBYID |
uniqueidentifier |
|
CHANGEAGENT.ID
|
FK to CHANGEAGENT. |
INFOSOURCECODEID |
uniqueidentifier |
yes |
INFOSOURCECODE.ID
|
FK to INFOSOURCECODE |
COUNTRYID |
uniqueidentifier |
yes |
COUNTRY.LOCALID
|
The country for this phone number. |
DONOTCALLREASONCODEID |
uniqueidentifier |
yes |
DONOTCALLREASONCODE.ID
|
The reason code translation ID for do not call. |
RELATIONSHIPID |
uniqueidentifier |
yes |
RELATIONSHIP.ID
|
Stores the relationship ID this phone number is associated with. |
Indexes
Index Name |
Fields |
Unique |
Primary |
Clustered |
IX_PHONE_CONSTITUENTID |
CONSTITUENTID |
|
|
|
IX_PHONE_CONSTITUENTID_PHONETYPECODEID_NUMBER |
CONSTITUENTID, PHONETYPECODEID, NUMBER |
|
|
|
IX_PHONE_DATEADDED |
DATEADDED |
|
|
yes |
IX_PHONE_DATECHANGED |
DATECHANGED |
|
|
|
IX_PHONE_NUMBERNOFORMAT |
NUMBERNOFORMAT |
|
|
|
IX_PHONE_RELATIONSHIPID |
RELATIONSHIPID |
|
|
|
PK_PHONE |
ID |
yes |
yes |
|
Triggers
Referenced by