PRINT'BEGIN INSTALL/UPDATE LV_CUSTOMER_SUBSTITUTE_HOUSEHOLD';GOSETANSI_NULLS,QUOTED_IDENTIFIERON;GO/***********************************************************************************************************************Author: Nick Reilingh, Fisher Center at Bard CollegeDescription: Join on customer_no to replace with household ID if one exists.Renaming this to match the convention of V_CUSTOMER_ views.***********************************************************************************************************************/CREATEORALTERVIEW[dbo].[LV_CUSTOMER_SUBSTITUTE_HOUSEHOLD]ASSELECTc.customer_no,expanded_customer_no=COALESCE(a.group_customer_no,c.customer_no)FROMdbo.T_CUSTOMERcLEFTJOINdbo.T_AFFILIATIONaONc.customer_no=a.individual_customer_noANDa.primary_ind='Y'ANDa.inactive='N';GOGRANTSELECTON[dbo].[LV_CUSTOMER_SUBSTITUTE_HOUSEHOLD]TO[ImpUsers];GO/* END INSTALL/UPDATE LV_CUSTOMER_SUBSTITUTE_HOUSEHOLD */
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.