BATCHREVENUECONSTITUENT

Stores data for constituents added to revenue batch.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
KEYNAME nvarchar(100) Default = '' Last name for individuals, Org name for organizations.
KEYNAMEPREFIX nvarchar(50) Default = '' For organizations, stores the name contents before the sort break slash.
FIRSTNAME nvarchar(50) Default = '' For individuals, stores the first name.
MIDDLENAME nvarchar(50) Default = '' For individuals, stores the middle name.
MAIDENNAME nvarchar(100) Default = '' For individuals, stores the maiden name.
NICKNAME nvarchar(50) Default = '' For individuals, stores the nickname.
GENDERCODE tinyint Default = 0 0=Unknown, 1=Male, 2=Female
BIRTHDATE UDT_FUZZYDATE Default = '00000000' For individuals, stores the date of birth.
ISORGANIZATION bit Default = 0 Indicates whether a record is an organization.
NUMEMPLOYEES int Default = 0 For organizations, stores the number of employees.
NUMSUBSIDIARIES int Default = 0 For organizations, stores the number of subsidiary organizations.
DONOTMAIL bit Default = 0
ADDRESSBLOCK nvarchar(150) Default = '' Contains the address lines.
CITY nvarchar(50) Default = '' Contains the address city.
POSTCODE nvarchar(12) Default = '' Contains the address post code.
NUMBER nvarchar(100) Default = '' Stores the phone number.
EMAILADDRESS UDT_EMAILADDRESS Default = '' The constituent's email address.
WEBADDRESS UDT_WEBADDRESS Default = '' The constituent's web address.
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.
ISGROUP bit Default = 0 Indicates whether a record is a group
GIVESANONYMOUSLY bit Default = 0 Indicates whether or not the record gives anonymously.
GROUPTYPECODE tinyint Default = 0 Indicates the type of group. A group type of Custom indicates that GROUPTYPEID will point to a custom group type record in the GROUPTYPE table.
GROUPDESCRIPTION nvarchar(300) Default = '' Provides a user-friendly description of the purpose of a group.
GROUPSTARTDATE datetime yes The date of the group's inception
DPC nvarchar(8) Default = '' Contains the address delivery point code
CART nvarchar(10) Default = '' Contains the address carrier route (CART).
LOT nvarchar(5) Default = '' Contains the address LOT.
OMITFROMVALIDATION bit Default = 0 Indicates this address should be omitted from validation.
LASTVALIDATIONATTEMPTDATE datetime yes Contains the date that this address was last validated.
VALIDATIONMESSAGE nvarchar(200) Default = '' Stores the validation message.
CERTIFICATIONDATA int Default = 0 Contains the certification data which shows with which release of the Postal Datafiles this address was last validated.
GROUPTYPE nvarchar(9) (Computed) yes CASE [GROUPTYPECODE] WHEN 0 THEN N'Household' WHEN 1 THEN N'Custom' END Provides a translation for the 'GROUPTYPECODE' field.
DONOTCALL bit Default = 0 Indicates whether the constituent should be called at the phone [NUMBER] in this record
DONOTEMAIL bit Default = 0 Indicates whether the constituent should be contacted at the [EMAILADDRESS] in this record
NAME nvarchar(154) (Computed) yes CASE ISORGANIZATION WHEN 1 THEN CASE KEYNAMEPREFIX WHEN '' THEN KEYNAME ELSE KEYNAMEPREFIX + ' ' + KEYNAME END ELSE CASE FIRSTNAME WHEN '' THEN '' ELSE FIRSTNAME + ' ' END + CASE MIDDLENAME WHEN '' THEN '' ELSE LEFT(MIDDLENAME,1) + '. ' END + KEYNAME END Returns the constituent name (First + Middle Initial + Last (individuals), Prefix + Org name (orgs)).
CONSTITUENCYCODEID uniqueidentifier yes
INFOSOURCECODEID uniqueidentifier yes
CLASSOF UDT_YEAR Default = ((0))
NAMEFORMATS xml yes
ORIGINAL_LASTNAME nvarchar(100) Default = ''
ORIGINAL_FIRSTNAME nvarchar(50) Default = ''
GENDER nvarchar(7) (Computed) yes CASE [GENDERCODE] WHEN 0 THEN N'Unknown' WHEN 1 THEN N'Male' WHEN 2 THEN N'Female' WHEN 3 THEN N'Other' END

Foreign Keys

Foreign Key Field Type Null Notes Description
EXISTINGCONSTITUENTID uniqueidentifier yes CONSTITUENT.LOCALID FK to CONSTITUENT
TITLECODEID uniqueidentifier yes TITLECODE.LOCALID FK to TITLECODE
SUFFIXCODEID uniqueidentifier yes SUFFIXCODE.LOCALID FK to SUFFIXCODE
MARITALSTATUSCODEID uniqueidentifier yes MARITALSTATUSCODE.LOCALID FK to MARITALSTATUSCODE
INDUSTRYCODEID uniqueidentifier yes INDUSTRYCODE.LOCALID FK to INDUSTRYCODE
PARENTCORPID uniqueidentifier yes CONSTITUENT.LOCALID FK to CONSTITUENT
ADDRESSTYPECODEID uniqueidentifier yes ADDRESSTYPECODE.ID FK to ADDRESSTYPECODE
COUNTRYID uniqueidentifier yes COUNTRY.LOCALID FK to COUNTRY
STATEID uniqueidentifier yes STATE.LOCALID FK to STATE
PHONETYPECODEID uniqueidentifier yes PHONETYPECODE.LOCALID FK to PHONETYPECODE
EMAILADDRESSTYPECODEID uniqueidentifier yes EMAILADDRESSTYPECODE.ID FK to EMAILADDRESSTYPECODE
CURRENTAPPUSERID uniqueidentifier yes APPUSER.ID FK to APPUSER
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
GROUPTYPEID uniqueidentifier yes GROUPTYPE.ID Points to a custom group type definition in the GROUPTYPE table
COUNTYCODEID uniqueidentifier yes COUNTYCODE.LOCALID FK to COUNTYCODE
CONGRESSIONALDISTRICTCODEID uniqueidentifier yes CONGRESSIONALDISTRICTCODE.ID FK to CONGRESSIONALDISTRICTCODE
DONOTMAILREASONCODEID uniqueidentifier yes DONOTMAILREASONCODE.ID FK to DONOTMAILREASONCODE
NAMEFORMATFUNCTIONID uniqueidentifier yes NAMEFORMATFUNCTION.ID The name format function which will be used to generate the household name if specified.
SITEID uniqueidentifier yes SITE.ID
CONSTITUENTSECURITYGROUPID uniqueidentifier yes CONSTIT_SECURITY_ATTRIBUTE.ID
GENDERCODEID uniqueidentifier yes GENDERCODE.ID

Indexes

Index Name Fields Unique Primary Clustered
IX_BATCHREVENUECONSTITUENT_DATEADDED DATEADDED yes
IX_BATCHREVENUECONSTITUENT_DATECHANGED DATECHANGED
IX_BATCHREVENUECONSTITUENT_EXISTINGCONSTITUENTID EXISTINGCONSTITUENTID
IX_BATCHREVENUECONSTITUENT_PARENTCORPID PARENTCORPID
PK_BATCHREVENUECONSTITUENT ID yes yes

Triggers

Trigger Name Description
TR_BATCHREVENUECONSTITUENT_AUDIT_UPDATE
TR_BATCHREVENUECONSTITUENT_AUDIT_DELETE

Referenced by

Referenced by Field
BATCHREVENUECONSTITUENTGROUPMEMBER GROUPID
BATCHREVENUECONSTITUENTGROUPMEMBER MEMBERID
BATCHREVENUECONSTITUENTRELATION CONSTITUENTID
BATCHREVENUECONSTITUENTRELATION RELATIONID