sql_dwilliams
Starting Member
4 Posts |
Posted - 2011-11-14 : 10:46:39
|
Also here is the DDL for the view:create view [dbo].[ar_customer] ( a_ar_customer_cid,c_cid_name1,c_cid_name2,c_the_prefix,c_addr_line1,c_addr_line2,c_cid_city,c_cid_state,c_cid_zip,c_cid_country,c_soc_sec_num,c_nw_sw,c_phone_number,c_fax_number,c_email_account,c_create_dept,c_account_type,c_resident,c_updated_by,c_updated_date,c_updated_time,c_internet,c_ssn,c_convert,c_geographical_cd,c_customer_type,c_vendor_number,c_external_ref,cp_dob,cp_phone,cp_drivers_license,cp_empr_cd,cp_empr,cp_empr_addr,cp_empr_city_st,cp_empr_zip,cp_empr_phone,cp_s_name,cp_s_dob,cp_s_phone,cp_s_drive_license,cp_s_empr_cd,cp_s_employer,cp_s_empr_addr,cp_s_empr_cst,cp_s_empr_zip,cp_s_empr_phone,ce_account,ce_category,ce_property_code,ce_license,ce_ar_code,ce_eft_code,ce_eft_bank,ce_bank_account,ce_filler,c_confidential, c_dept, c_employee_number, c_filler, c_pod, c_status, ce_eft_draft_day ) as select arcs_acct ,arcs_name1 ,arcs_name2 ,arcs_the ,arcs_addr1 ,arcs_addr2 ,arcs_city ,arcs_state ,arcs_zip ,arcs_country , CASE WHEN rtrim(ltrim(SSN.rupr_value))='Y' THEN arcs_ssn ELSE 'xxx-xx-xxxx' END,arcs_person ,arcs_phone ,arcs_fax ,arcs_email ,arcs_module ,arcs_cust_class ,arcs_resident ,arcs_updt_by ,arcs_updt_date ,arcs_updt_time ,arcs_internet , CASE WHEN rtrim(ltrim(SSN.rupr_value))='Y' THEN arcs_ssn ELSE 'xxx-xx-xxxx' END,arcs_convert ,arcs_geo_code ,arcs_cust_type ,arcs_vendor_num ,arcs_external_ref ,arcp_dob ,arcp_phone ,arcp_drivers_lic ,arcp_empr_cd ,arcp_employer ,arcp_empr_addr ,arcp_empr_city_st ,arcp_empr_zip ,arcp_empr_phone ,arcp_s_name ,arcp_s_dob ,arcp_s_phone ,arcp_s_drive_lic ,arcp_s_empr_cd ,arcp_s_employer ,arcp_s_empr_addr ,arcp_s_empr_cst ,arcp_s_empr_zip ,arcp_s_empr_phone ,arce_acct ,arce_cat ,arce_prop ,arce_lic ,arce_ar_code ,arce_eft_code ,arce_bank ,arce_bank_acct ,arce_filler ,arcs_confidential , arcs_dept , arcs_employee_num , arcs_filler , arcs_pod , arcs_status , arce_prfr_drft_dy from arcstcid T0 INNER JOIN sprviews ZZ on (ZZ.sprv_idcode = CAST(substring(system_user,charindex('\',system_user)+1,len(system_user)) AS CHAR(20))) and ZZ.sprv_ar='Y' LEFT OUTER JOIN arcstper T1 on T0.arcs_acct = T1.arcp_acct LEFT OUTER JOIN arcsteft T2 on T0.arcs_acct = T2.arce_acct LEFT OUTER JOIN rousrper SSN on ZZ.sprv_idcode = SSN.rupr_userid and SSN.rupr_permcat = 'ACCT_RCV' and SSN.rupr_permkey='arid_show_ssn' |
|
|