SELECT * FROM OPENQUERY(GPSERVER, '
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,
  [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,
  [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,
  RTRIM([TAXSCHID]) AS taxschid,
  RTRIM([SLSCHDID]) AS slschdid,
  RTRIM([FRTSCHID]) AS frtschid,
  RTRIM([MSCSCHID]) AS mscschid,
  RTRIM([CURNCYID]) AS curncyid,
  RTRIM([SHIPMTHD]) AS shipmthd,
  RTRIM([PYMTRMID]) AS pymtrmid,
  [TRDISAMT] AS trdisamt,
  [NOTEINDX] AS noteindx,
  [VOIDSTTS] AS voidstts,
  [VOIDDATE] AS voiddate,
  RTRIM([BALFWDNM]) AS balfwdnm,
  [CSHRCTYP] AS cshrctyp,
  [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,
  [BackoutTradeDisc] AS backouttradedisc,
  [BKTFRTAM] AS bktfrtam,
  [BKTMSCAM] AS bktmscam,
  [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 CHG.dbo.RM30101
WHERE [DEX_ROW_TS] > ''{rm30101_ts}''
')
