Program Name script

I've heard there is a script out there that will automatically update the Program name in the Constituent Record based on the membership level. Does anyone have this script? Thanks in advance!

Parents Reply Children
  • Unfortunately, I never received the script. :(

  • Hi all, sorry to hear you didn't recieve my email David!!

    This is the version I used to update TX_CUST_PROGRAM with same programme name for all constituents in a list. You'd need to make seperate lists and rename each time but useful for bulk. Not the perfect solution but one we used at the time. Please test first as always. You'll want to note your program and donation levels first before doing this.

    insert into dbo.TX_CUST_PROGRAM (customer_no,program_no,donation_level,cust_pname,sort_name)
    --view table with new information before committing
    select lc.customer_no,4,1,'Anonymous','Anonymous'
    from t_list_contents lc
    left join dbo.TX_CUST_PROGRAM cp WITH (NOLOCK) on cp.customer_no=lc.customer_no and cp.program_no=4
    where lc.list_no=116338
    and cp.program_no is null

    --OR can be done through the following methods
    select lc.customer_no,4,1,'Anonymous','Anonymous'
    from t_list_contents lc
    where lc.list_no=113688
    and lc.customer_no not in (select customer_no from dbo.TX_CUST_PROGRAM cp where cp.program_no=4)
    --or
    select lc.customer_no,4,1,'Anonymous','Anonymous'
    from t_list_contents lc
    where lc.list_no=113688
    and not exists (select 1 from dbo.TX_CUST_PROGRAM cp where cp.customer_no=lc.customer_no and cp.program_no=4)