BATCHSPONSORSHIP

Stores information about a sponsorship batch

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
SEQUENCE int Default = 0
CONSTITUENTID uniqueidentifier
DONORID uniqueidentifier
PLANNEDENDDATE date yes Planned end date for fixed term sponsorships.
SPONSORSHIPOPPORTUNITYTYPECODE tinyint Default = 1 1=Child, 2=Project
SPONSORSHIPOPPORTUNITYTYPE nvarchar(7) (Computed) yes CASE [SPONSORSHIPOPPORTUNITYTYPECODE] WHEN 1 THEN N'Child' WHEN 2 THEN N'Project' END Provides a translation for the 'SPONSORSHIPOPPORTUNITYTYPECODE' field.
STARTDATE date yes
ENDDATE date yes
CHILDGENDERCODE tinyint Default = 0 0=Greatest need, 1=Male, 2=Female
CHILDGENDER nvarchar(13) (Computed) yes CASE [CHILDGENDERCODE] WHEN 0 THEN N'Greatest need' WHEN 1 THEN N'Male' WHEN 2 THEN N'Female' END Provides a translation for the 'CHILDGENDERCODE' field.
ISHIVPOSITIVECODE tinyint Default = 0 0=Greatest need, 1=Yes, 2=No
ISHIVPOSITIVE nvarchar(13) (Computed) yes CASE [ISHIVPOSITIVECODE] WHEN 0 THEN N'Greatest need' WHEN 1 THEN N'Yes' WHEN 2 THEN N'No' END Provides a translation for the 'ISHIVPOSITIVECODE' field.
HASCONDITIONCODE tinyint Default = 0 0=Greatest need, 1=Yes, 2=No
HASCONDITION nvarchar(13) (Computed) yes CASE [HASCONDITIONCODE] WHEN 0 THEN N'Greatest need' WHEN 1 THEN N'Yes' WHEN 2 THEN N'No' END Provides a translation for the 'HASCONDITIONCODE' field.
ISORPHANEDCODE tinyint Default = 0 0=Greatest need, 1=Yes, 2=No
ISORPHANED nvarchar(13) (Computed) yes CASE [ISORPHANEDCODE] WHEN 0 THEN N'Greatest need' WHEN 1 THEN N'Yes' WHEN 2 THEN N'No' END Provides a translation for the 'ISORPHANEDCODE' field.
ISSOLESPONSORSHIP bit Default = 0 Indicates that this sponsorship is the sole sponsorship for a child.
AMOUNT money Default = 0 Amount of sponsorship
PAYMENTMETHODCODE tinyint Default = 0 The method of payment in which the revenue was received.
FREQUENCYCODE tinyint Default = 0 Indicates the frequency of the installment.
FREQUENCY nvarchar(18) (Computed) yes CASE [FREQUENCYCODE] WHEN 0 THEN N'Annually' WHEN 1 THEN N'Semi-annually' WHEN 2 THEN N'Quarterly' WHEN 3 THEN N'Monthly' WHEN 4 THEN N'Irregular' WHEN 5 THEN N'Single Installment' WHEN 6 THEN N'Bimonthly' WHEN 7 THEN N'Semi-Monthly' WHEN 8 THEN N'Biweekly' WHEN 9 THEN N'Weekly' END Provides a translation for the 'FREQUENCYCODE' field.
AUTOPAY bit Default = 1 Automatically pay installments.
REFERENCEDATE UDT_FUZZYDATE Default = '00000000' The date that the reference was made.
REFERENCENUMBER nvarchar(20) Default = ''
CONSTITUENTACCOUNTID uniqueidentifier yes
SENDREMINDER bit Default = 0 Send reminders for payments
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.
FINDERNUMBER bigint Default = ((0))
SOURCECODE nvarchar(50) Default = ''
APPEALID uniqueidentifier yes
CHANNELCODEID uniqueidentifier yes
MAILINGID uniqueidentifier yes
REFERENCE nvarchar(255) Default = ''
REVENUECATEGORYID uniqueidentifier yes
ISGIFTSPONSORSHIP bit Default = 0
REVENUESCHEDULESTARTDATE datetime yes
REVENUESCHEDULEENDDATE datetime yes
BASEEXCHANGERATEID uniqueidentifier yes The exchange rate used to convert from transaction amount to amount.
EXCHANGERATE decimal(20, 8) Default = 0 The rate to use when adding a spot rate.
COMMITMENTID nvarchar(100) Default = '' The commitment ID that will be assigned to this sponsorship record
PAYMENTMETHOD nvarchar(47) (Computed) yes CASE [PAYMENTMETHODCODE] WHEN 0 THEN N'Cash' WHEN 1 THEN N'Check' WHEN 2 THEN N'Credit card' WHEN 3 THEN N'Direct debit' WHEN 4 THEN N'Stock' WHEN 5 THEN N'Property' WHEN 6 THEN N'Gift-in-kind' WHEN 9 THEN N'None' WHEN 10 THEN N'Other' WHEN 11 THEN N'Standing order' WHEN 98 THEN N'Credit card - store last 4 digits for reference' END
CARDHOLDERNAME nvarchar(255) Default = ''
CREDITCARDPARTIALNUMBER nvarchar(4) Default = ''
EXPIRESON UDT_FUZZYDATE Default = '00000000'

Foreign Keys

Foreign Key Field Type Null Notes Description
BATCHID uniqueidentifier BATCH.ID FK to BATCH
SPONSORSHIPPROGRAMID uniqueidentifier SPONSORSHIPPROGRAM.ID Points to a Sponsorship Program definition in the SPONSORSHIPPROGRAM table
SPONSORSHIPOPPORTUNITYID uniqueidentifier yes SPONSORSHIPOPPORTUNITY.ID FK to SPONSORSHIPOPPORTUNITY
SPONSORSHIPLOCATIONID uniqueidentifier yes SPONSORSHIPLOCATION.ID The location preference for this sponsorship.
SPONSORSHIPOPPORTUNITYAGERANGEID uniqueidentifier yes SPONSORSHIPOPPORTUNITYAGERANGE.ID Points to a custom Sponsorship Opportunity Age Range definition in the SPONSORSHIPOPPORTUNITYAGERANGE table, for child records only.
SPROPPPROJECTCATEGORYCODEID uniqueidentifier yes SPROPPPROJECTCATEGORYCODE.ID FK to SPROPPPROJECTCATEGORYCODE
CREDITCARDID uniqueidentifier yes CREDITCARD.ID Stores the credit card details.
RESERVATIONKEYID uniqueidentifier yes SPONSORSHIPOPPORTUNITYRESERVEPROCESS.ID Reservation key.
RESERVEDOPPORTUNITYID uniqueidentifier yes SPONSORSHIPOPPORTUNITY.ID Reserved opportunity.
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
EXPIRATIONREASONID uniqueidentifier yes SPONSORSHIPREASON.ID FK to SPONSORSHIPREASON
BASECURRENCYID uniqueidentifier yes CURRENCY.ID The base currency associated with this revenue.
TRANSACTIONCURRENCYID uniqueidentifier yes CURRENCY.ID The transaction currency associated with this revenue.
SEPAMANDATEID uniqueidentifier yes SEPAMANDATE.ID
CREDITTYPECODEID uniqueidentifier yes CREDITTYPECODE.ID
OTHERPAYMENTMETHODCODEID uniqueidentifier yes OTHERPAYMENTMETHODCODE.ID

Indexes

Index Name Fields Unique Primary Clustered
IX_BATCHSPONSORSHIP_BASECURRENCYID BASECURRENCYID
IX_BATCHSPONSORSHIP_BASEEXCHANGERATEID BASEEXCHANGERATEID
IX_BATCHSPONSORSHIP_BATCHID BATCHID
IX_BATCHSPONSORSHIP_CONSTITUENTID CONSTITUENTID
IX_BATCHSPONSORSHIP_CREDITCARDID CREDITCARDID
IX_BATCHSPONSORSHIP_DATEADDED DATEADDED yes
IX_BATCHSPONSORSHIP_DATECHANGED DATECHANGED
IX_BATCHSPONSORSHIP_EXPIRATIONREASONID EXPIRATIONREASONID
IX_BATCHSPONSORSHIP_RESERVATIONKEYID RESERVATIONKEYID
IX_BATCHSPONSORSHIP_RESERVEDOPPORTUNITYID RESERVEDOPPORTUNITYID
IX_BATCHSPONSORSHIP_SPONSORSHIPLOCATIONID SPONSORSHIPLOCATIONID
IX_BATCHSPONSORSHIP_SPONSORSHIPOPPORTUNITYAGERANGEID SPONSORSHIPOPPORTUNITYAGERANGEID
IX_BATCHSPONSORSHIP_SPONSORSHIPOPPORTUNITYID SPONSORSHIPOPPORTUNITYID
IX_BATCHSPONSORSHIP_SPONSORSHIPPROGRAMID SPONSORSHIPPROGRAMID
IX_BATCHSPONSORSHIP_SPROPPPROJECTCATEGORYCODEID SPROPPPROJECTCATEGORYCODEID
IX_BATCHSPONSORSHIP_TRANSACTIONCURRENCYID TRANSACTIONCURRENCYID
PK_BATCHSPONSORSHIP ID yes yes

Triggers

Trigger Name Description
TR_BATCHSPONSORSHIP_INSERTUPDATE_CURRENCY
TR_BATCHSPONSORSHIP_AUDIT_UPDATE
TR_BATCHSPONSORSHIP_AUDIT_DELETE

Referenced by

Referenced by Field
BATCHSPONSORSHIPBATCHSYSTEMMESSAGES BATCHSPONSORSHIPID
BATCHSPONSORSHIPBATCHUSERMESSAGE ID