SELECT
  RTRIM([CUSTNMBR]) AS custnmbr,
  RTRIM([CPRCSTNM]) AS cprcstnm,
  RTRIM([DOCNUMBR]) AS docnumbr,
  RTRIM([CHEKNMBR]) AS cheknmbr,
  RTRIM([BACHNUMB]) AS bachnumb,
  RTRIM([BCHSOURC]) AS bchsourc,
  RTRIM([TRXSORCE]) AS trxsorce,
  [RMDTYPAL] AS rmdtypal,
  [CSHRCTYP] AS cshrctyp,
  RTRIM([CBKIDCRD]) AS cbkidcrd,
  RTRIM([CBKIDCSH]) AS cbkidcsh,
  RTRIM([CBKIDCHK]) AS cbkidchk,
  [DUEDATE] AS duedate,
  [DOCDATE] AS docdate,
  [POSTDATE] AS postdate,
  RTRIM([PSTUSRID]) AS pstusrid,
  [GLPOSTDT] AS glpostdt,
  [LSTEDTDT] AS lstedtdt,
  RTRIM([LSTUSRED]) AS lstusred,
  [ORTRXAMT] AS ortrxamt,
  [CURTRXAM] AS curtrxam,
  [SLSAMNT] AS slsamnt,
  [COSTAMNT] AS costamnt,
  [FRTAMNT] AS frtamnt,
  [MISCAMNT] AS miscamnt,
  [TAXAMNT] AS taxamnt,
  [COMDLRAM] AS comdlram,
  [CASHAMNT] AS cashamnt,
  [DISTKNAM] AS distknam,
  [DISAVAMT] AS disavamt,
  [DISAVTKN] AS disavtkn,
  [DISCRTND] AS discrtnd,
  [DISCDATE] AS discdate,
  [DSCDLRAM] AS dscdlram,
  [DSCPCTAM] AS dscpctam,
  [WROFAMNT] AS wrofamnt,
  RTRIM([TRXDSCRN]) AS trxdscrn,
  RTRIM([CSPORNBR]) AS cspornbr,
  RTRIM([SLPRSNID]) AS slprsnid,
  RTRIM([SLSTERCD]) AS slstercd,
  [DINVPDOF] AS dinvpdof,
  [PPSAMDED] AS ppsamded,
  [GSTDSAMT] AS gstdsamt,
  [DELETE1] AS delete1,
  [AGNGBUKT] AS agngbukt,
  [VOIDSTTS] AS voidstts,
  [VOIDDATE] AS voiddate,
  RTRIM([TAXSCHID]) AS taxschid,
  RTRIM([CURNCYID]) AS curncyid,
  RTRIM([PYMTRMID]) AS pymtrmid,
  RTRIM([SHIPMTHD]) AS shipmthd,
  [TRDISAMT] AS trdisamt,
  RTRIM([SLSCHDID]) AS slschdid,
  RTRIM([FRTSCHID]) AS frtschid,
  RTRIM([MSCSCHID]) AS mscschid,
  [NOTEINDX] AS noteindx,
  [Tax_Date] AS tax_date,
  [APLYWITH] AS aplywith,
  [SALEDATE] AS saledate,
  [CORRCTN] AS corrctn,
  [SIMPLIFD] AS simplifd,
  [Electronic] AS electronic,
  [ECTRX] AS ectrx,
  [BKTSLSAM] AS bktslsam,
  [BKTFRTAM] AS bktfrtam,
  [BKTMSCAM] AS bktmscam,
  [BackoutTradeDisc] AS backouttradedisc,
  [Factoring] AS factoring,
  [DIRECTDEBIT] AS directdebit,
  RTRIM([ADRSCODE]) AS adrscode,
  [EFTFLAG] AS eftflag,
  [DEX_ROW_TS] AS dex_row_ts,
  [DEX_ROW_ID] AS dex_row_id
FROM [GPSERVER].[CHG].[dbo].[RM20101]
