I had gone to restore a GP 2013 database in SSMS and was greeted with database is in use message. When I checked the Activity Monitor there was an application called .Net SQL Client Provider and when I traced the SPID it was running this statement and others over and over again. Is this the MR service doing this and, if not, what is issuing these SQL statements?
SELECT ACTNUMBR_1, ACTNUMBRID_1, ACTNUMBR_2, ACTNUMBRID_2, ACTNUMBR_3, ACTNUMBRID_3, ACTDESCR, Category, CategoryID, ACTNUMST, ACTINDX, PERIODID, TRXDATE, SOURCDOC, REFRENCE, ACCATNUM, TRXSORCE, XCHGRATE, ORTRXSRC, SERIES, VOIDED, Adjustment_Transaction, Ledger_Name, JRNENTRY, CURRNIDX, FUNCRIDX, GLTransactionID, DSCRIPTN, ORDOCNUM, ORMSTRID, ORMSTRNM, ORTRXTYP, DebitAmount, CreditAmount, OrigDebitAmount, OrigCreditAmount, SEQNUMBR, keyString, BBF, YEAR1, KeyTable FROM (SELECT seg1.ACTNUMBR_1, seg1def.DEX_ROW_ID as ACTNUMBRID_1, seg2.ACTNUMBR_2, seg2def.DEX_ROW_ID as ACTNUMBRID_2, seg3.ACTNUMBR_3, seg3def.DEX_ROW_ID as ACTNUMBRID_3, seg1.ACTDESCR, GL102.ACCATDSC as Category, GL102.DEX_ROW_ID as CategoryID, GL105.ACTNUMST, GL105.ACTINDX, GL0.PERIODID, GL0.TRXDATE, GL0.SOURCDOC, GL0.REFRENCE, seg1.ACCATNUM, GL0.TRXSORCE, GL0.XCHGRATE, GL0.ORTRXSRC, GL0.SERIES, GL0.VOIDED, GL0.Adjustment_Transaction, GL401.Ledger_Name, GL0.JRNENTRY, GL0.CURRNIDX, MC4.FUNCRIDX, GL0.DEX_ROW_ID as GLTransactionID, GL0.REFRENCE DSCRIPTN, GL0.ORDOCNUM, GL0.ORMSTRID, GL0.ORMSTRNM, GL0.ORTRXTYP, GL0.DEBITAMT as DebitAmount, GL0.CRDTAMNT as CreditAmount, GL0.ORDBTAMT as OrigDebitAmount, GL0.ORCRDAMT as OrigCreditAmount,GL0.SEQNUMBR, (rtrim(cast(GL0.DEX_ROW_ID as nvarchar(30)))) as keyString, SY401.BBF, OPENYEAR as YEAR1, 'GL20000' KeyTable FROM GL20000 GL0 join GL00105 GL105 on GL0.ACTINDX = GL105.ACTINDX join GL40001 GL401 on GL401.Ledger_ID = GL0.Ledger_ID cross join MC40000 MC4 JOIN GL00100 seg1 on seg1.ACTINDX = GL105.ACTINDX left join GL40200 seg1def on seg1def.SGMNTID = seg1.ACTNUMBR_1 and seg1def.SGMTNUMB = 1 JOIN GL00100 seg2 on seg2.ACTINDX = GL105.ACTINDX left join GL40200 seg2def on seg2def.SGMNTID = seg2.ACTNUMBR_2 and seg2def.SGMTNUMB = 2 JOIN GL00100 seg3 on seg3.ACTINDX = GL105.ACTINDX left join GL40200 seg3def on seg3def.SGMNTID = seg3.ACTNUMBR_3 and seg3def.SGMTNUMB = 3 left join GL00102 GL102 on GL102.ACCATNUM = seg1.ACCATNUM join (select 0 BBF, YEAR1, PERIODID, PERIODDT, PERDENDT from SY40100 where FORIGIN = 1 and PERIODID = 0 union select 1 BBF, YEAR1, PERIODID, PERIODDT, PERDENDT from SY40100 where FORIGIN = 1 and PERIODID != 0) SY401 on GL0.OPENYEAR = SY401.YEAR1 and ((SY401.BBF = 0 and GL0.TRXDATE = SY401.PERIODDT and GL0.SOURCDOC in ('BBF', 'P/L')) OR (SY401.BBF = 1 and GL0.TRXDATE <= SY401.PERDENDT and GL0.TRXDATE >= SY401.PERIODDT)) INNER JOIN CHANGETABLE(CHANGES GL20000, 7) GL0_CT ON GL0.DEX_ROW_ID = GL0_CT.DEX_ROW_ID AND GL0_CT.SYS_CHANGE_VERSION <= 7 ) GL0
*This post is locked for comments