How can I find out which DB script these are?

INSERT INTO accnt 
SELECT          Concat('EBB','-','@cntryCode', '-',Trim(mast.masterno))                      AS acct_srogt_id , 
                Trim(mast.masterno)                                                          AS acct_host_num ,
                mast.statusflag                                                              AS acct_sts_type_cd ,
                ''                                                                           AS prvsn_sts_type_cd ,
                ''                                                                           AS acct_auto_prvsn_cd ,
                ''                                                                           AS acct_ptfol_ctry_cd ,
                mast.armcode                                                                 AS arm_cd ,
                ''                                                                           AS acct_cury_cd ,
                ''                                                                           AS base_cury_cd ,
                ''                                                                           AS acct_blg_type_cd ,
                ''                                                                           AS acct_int_type_cd ,
                ''                                                                           AS acct_int_rt ,
                ''                                                                           AS anl_int_sprd_rt ,
                ''                                                                           AS eff_int_rt ,
                masteropendate                                                               AS acct_open_dt ,
                closingdate                                                                  AS acct_clse_dt ,
                ''                                                                           AS acct_appr_dt ,
                ''                                                                           AS acct_stm_cyc_day ,
                ''                                                                           AS acct_div_cd ,
                ''                                                                           AS effective_start_date ,
                ''                                                                           AS acct_sts_type_desc ,
                                Concat('EBB','-','@cntryCode','-',Trim(arm.bankid))          AS arm_emp_srogt_id , 
                'EBB_ACCT_01'                                                                AS prcs_id ,
                ''                                                                           AS acct_closr_rsn ,
                ''                                                                           AS prvsn_sts_type_desc ,
                ''                                                                           AS acct_acq_chnl_meth ,
                mast.segmentcode                                                             AS acct_segmt_cd ,
                seg.NAME                                                                     AS acct_segmt_desc ,
                ''                                                                           AS intrnl_inst_clas_cd ,
                ''                                                                           AS intrnl_instl_clas_cd_desc ,
                arm.NAME                                                                     AS arm_nm ,
                ''                                                                           AS acct_last_cr_tran_dt ,
                ''                                                                           AS acct_book_loc ,
                accttype                                                                     AS acct_cat_cd ,
                ''                                                                           AS acct_cat_desc ,
                ''                                                                           AS busn_cat_cd ,
                ''                                                                           AS busn_cat_cd_desc ,
                ''                                                                           AS acct_int_type_cd_desc ,
                ''                                                                           AS actg_meth ,
                ''                                                                           AS acct_sts_chg_dt ,
                ''                                                                           AS prvsn_sts_chg_dt ,
                ''                                                                           AS acct_shrt_nm ,
                ''                                                                           AS intnl_bank_acct_num ,
                ''                                                                           AS deal_lien_num ,
                ''                                                                           AS prod_cd ,
                ''                                                                           AS lend_type ,
                ''                                                                           AS lend_type_desc ,
                ''                                                                           AS orig_maturty_dt ,
                ''                                                                           AS maturty_dt ,
                ''                                                                           AS ln_prps_cd ,
                ''                                                                           AS ln_prps_cd_desc ,
                ''                                                                           AS ptfol_id_num ,
                ''                                                                           AS ptfol_desc ,
                ''                                                                           AS ln_bss_cd ,
                ''                                                                           AS revn_chrg_cd ,
                ''                                                                           AS revn_chrg_cd_desc ,
                ''                                                                           AS ln_type_cd ,
                ''                                                                           AS ln_type_desc ,
                ''                                                                           AS ln_scty_cd ,
                ''                                                                           AS ln_clas ,
                ''                                                                           AS ln_appl_dclne_cd ,
                ''                                                                           AS ln_risk_clas_cd ,
                ''                                                                           AS drp_acct_fl ,
                ''                                                                           AS impairment_fl ,
                ''                                                                           AS stm_cd ,
                ''                                                                           AS acct_stm_addressing_titl ,
                ''                                                                           AS acct_drmt_dt,
                                Concat('EBBS','-','@cntryCode','-',Trim(rel.relationshipno)) AS prty_srogt_id, 
                ''                                                                           AS drp_acct_num,
                                Concat('EBB','-','@cntryCode','-',Trim(mast.branchcode))     AS brnch_srogt_id , 
                t.riskcode                                                                   AS risk_cd,
                risk.description                                                             AS risk_cd_desc
FROM            @PREFIX2_MAST MAST 
LEFT OUTER JOIN @PREFIX2_ARM ARM 
ON              mast.armcode=arm.armcode 
LEFT OUTER JOIN @PREFIX2_SEG SEG 
ON              mast.segmentcode=seg.segmentcode 
LEFT JOIN       @PREFIX2_MASTREL MSTREL 
ON              mstrel.masterno=mast.masterno 
AND             mstrel.primaryflag='Y' 
LEFT JOIN       @PREFIX2_REL REL 
ON              mstrel.relationshipno=rel.relationshipno 
AND             rel.relationshiptype='C' 
LEFT JOIN 
                ( 
                       SELECT riskcode, 
                              base.masterno 
                       FROM   ( 
                                       SELECT   riskcode, 
                                                masterno , 
                                                Row_number() OVER (partition BY masterno ORDER BY seqno DESC) AS max_row
                                       FROM     @PREFIX2_RSKIND RSKND) base 
                       WHERE  base.max_row=1) t 
ON              mast.masterno=t.masterno 
LEFT JOIN       @PREFIX2_RISK RISK

How can I find out which DB script these are please?

1 answer

  • answered 2018-04-17 05:40 sujit

    This snippet seems to be an incomplete extract from a T-SQL script. Refer the @table specific documentation here