SPONSORSHIP
Table that holds the relationship between a sponsor and a sponsorship opportunity
Primary Key
| Primary Key | Field Type | 
|---|---|
| ID | uniqueidentifier | 
Fields
| Field | Field Type | Null | Notes | Description | 
|---|---|---|---|---|
| STATUSCODE | tinyint | Default = 1 | Status of this sponsorship. | |
| STATUS | nvarchar(8) (Computed) | yes | CASE [STATUSCODE] WHEN 0 THEN N'Pending' WHEN 1 THEN N'Active' WHEN 2 THEN N'Inactive' END | Provides a translation for the 'STATUSCODE' field. | 
| STARTDATE | date | yes | ||
| ENDDATE | date | yes | ||
| PLANNEDENDDATE | 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. | |
| 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. | 
| ISMOSTRECENTFORCOMMITMENT | bit | Default = 0 | Indicates the active or last sponsorship for a commitment. | 
Foreign Keys
| Foreign Key | Field Type | Null | Notes | Description | 
|---|---|---|---|---|
| SPONSORSHIPCOMMITMENTID | uniqueidentifier | SPONSORSHIPCOMMITMENT.ID | The commitment of which this sponsorship is a part. | |
| CONSTITUENTID | uniqueidentifier | CONSTITUENT.LOCALID | FK to CONSTITUENT | |
| SPONSORSHIPPROGRAMID | uniqueidentifier | SPONSORSHIPPROGRAM.ID | FK to SPONSORSHIPPROGRAM | |
| SPONSORSHIPOPPORTUNITYID | uniqueidentifier | SPONSORSHIPOPPORTUNITY.ID | FK to SPONSORSHIPOPPORTUNITY | |
| REVENUESPLITID | uniqueidentifier | yes | FINANCIALTRANSACTIONLINEITEM.ID | The recurring gift split against which payments will be applied for this sponsorship. | 
| 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 | 
| ADDEDBYID | uniqueidentifier | CHANGEAGENT.ID | FK to CHANGEAGENT. | |
| CHANGEDBYID | uniqueidentifier | CHANGEAGENT.ID | FK to CHANGEAGENT. | |
| EXPIRATIONREASONID | uniqueidentifier | yes | SPONSORSHIPREASON.ID | FK to SPONSORSHIPREASON | 
Indexes
| Index Name | Fields | Unique | Primary | Clustered | 
|---|---|---|---|---|
| IX_SPONSORSHIP_CONSTITUENTID | CONSTITUENTID | |||
| IX_SPONSORSHIP_DATEADDED | DATEADDED | yes | ||
| IX_SPONSORSHIP_DATECHANGED | DATECHANGED | |||
| IX_SPONSORSHIP_EXPIRATIONREASONID | EXPIRATIONREASONID | |||
| IX_SPONSORSHIP_REVENUESPLITID | REVENUESPLITID | |||
| IX_SPONSORSHIP_SPONSORSHIPCOMMITMENTID | SPONSORSHIPCOMMITMENTID | |||
| IX_SPONSORSHIP_SPONSORSHIPLOCATIONID | SPONSORSHIPLOCATIONID | |||
| IX_SPONSORSHIP_SPONSORSHIPOPPORTUNITYAGERANGEID | SPONSORSHIPOPPORTUNITYAGERANGEID | |||
| IX_SPONSORSHIP_SPONSORSHIPOPPORTUNITYID | SPONSORSHIPOPPORTUNITYID | |||
| IX_SPONSORSHIP_SPONSORSHIPPROGRAMID | SPONSORSHIPPROGRAMID | |||
| IX_SPONSORSHIP_SPROPPPROJECTCATEGORYCODEID | SPROPPPROJECTCATEGORYCODEID | |||
| PK_SPONSORSHIP | ID | yes | yes | 
Triggers
| Trigger Name | Description | 
|---|---|
| TR_SPONSORSHIP_AUDIT_UPDATE | |
| TR_SPONSORSHIP_AUDIT_DELETE | |
| TR_SPONSORSHIP_AUDIT_ETLDELETEDID | 
Referenced by
| Referenced by | Field | 
|---|---|
| MKTSPONSORSHIPMAILINGTEMPLATEACTIVATED | SPONSORSHIPID | 
| SALESORDERITEMSPONSORSHIP | SPONSORSHIPID | 
| SPONSORSHIPPAYMENT | SPONSORSHIPID | 
| SPONSORSHIPRECURRINGADDITIONALGIFT | SPONSORSHIPID | 
| SPONSORSHIPTRANSACTION | CONTEXTSPONSORSHIPID | 
| SPONSORSHIPTRANSACTION | TARGETSPONSORSHIPID | 
| SPONSORSHIPTRANSACTION | DECLINEDSPONSORSHIPID |