V_QUERY_CONSTITUENTORIGINATION

This provides the ability to query the constituent infosource field.

Fields

Field Field Type Null Description
ID uniqueidentifier System record ID
INFOSOURCECODEID_TRANSLATION nvarchar(100) yes Constituent source
REVENUEID uniqueidentifier yes Revenue
ADDEDBY_APPLICATION nvarchar(200) yes Added by application
ADDEDBY_USERNAME nvarchar(128) yes Added by user name
CHANGEDBY_APPLICATION nvarchar(200) yes Changed by application
CHANGEDBY_USERNAME nvarchar(128) yes Changed by user name
DATEADDED datetime Date added
DATECHANGED datetime Date changed
TSLONG bigint yes Timestamp value
ORIGIN nvarchar(9) yes Origin
ORIGININFO nvarchar(100) yes Origin information

Definition

Copy
/*
Generated by Blackbaud AppFx Platform
Date:  11/30/2010 11:26:31 PM
Assembly Version:  Blackbaud.AppFx.Platform.SqlClr, Version=2.8.2022.0, Culture=neutral, PublicKeyToken=null
Copyright Blackbaud
*/
CREATE VIEW dbo.V_QUERY_CONSTITUENTORIGINATION AS



                select
                    CONSTITUENTORIGINATION.ID,
                    dbo.UFN_INFOSOURCECODE_GETDESCRIPTION(CONSTITUENTORIGINATION.INFOSOURCECODEID) as [INFOSOURCECODEID_TRANSLATION],
                    CONSTITUENTORIGINATION.REVENUEID,
                    [ADDEDBY].APPLICATIONNAME as [ADDEDBY_APPLICATION],
                    [ADDEDBY].USERNAME as [ADDEDBY_USERNAME],
                    [CHANGEDBY].APPLICATIONNAME as [CHANGEDBY_APPLICATION],
                    [CHANGEDBY].USERNAME as [CHANGEDBY_USERNAME],
                    CONSTITUENTORIGINATION.DATEADDED,
                    CONSTITUENTORIGINATION.DATECHANGED,
                    CONSTITUENTORIGINATION.TSLONG,
                    CONSTITUENTORIGINATION.ORIGIN,
                    case 
                        when CONSTITUENTORIGINATION.ORIGINCODE <> 0 then 
                            dbo.UFN_CONSTITUENTORIGINATION_ORIGINCODE_GETDESCRIPTION([ORIGINCODE]) 
                        else dbo.UFN_INFOSOURCECODE_GETDESCRIPTION(CONSTITUENTORIGINATION.INFOSOURCECODEID) 
                    end as [ORIGININFO]

                    /*EXTENTION*/

                from dbo.CONSTITUENTORIGINATION
                left join dbo.CHANGEAGENT as [ADDEDBY] 
                    on [ADDEDBY].ID = CONSTITUENTORIGINATION.ADDEDBYID
                left join dbo.CHANGEAGENT as [CHANGEDBY] 
                    on [CHANGEDBY].ID = CONSTITUENTORIGINATION.CHANGEDBYID