Skip to main content
Microsoft Dynamics GP forum
Unanswered

Dynamics GP 2018 "Purchasing Requsition Transactions" window crashing

editSubscribe (0) ShareShare
ReportReport
Posted on by UG Leader

We upgraded from GP 2015 to 2018 a couple of weeks ago and are working thru some minor issues. One that is causing users some headaches is whenever a user clicks to "view all purchasing requsitions" or on the navigation option "Purchasing Requisition Transactions" gp thinks for a moment and then crashes. The other options seem to work fine (not submitted, 30 days, etc.) but the "view all" option always crashes.

Has anyone seen this before?

Here is the error details i'm getting:

Problem signature:
Problem Event Name: APPCRASH
Application Name: Dynamics.exe
Application Version: 18.0.10.0
Application Timestamp: 59e61edf
Fault Module Name: Dynamics.exe
Fault Module Version: 18.0.10.0
Fault Module Timestamp: 59e61edf
Exception Code: c00000fd
Exception Offset: 004ea259
OS Version: 6.3.9600.2.0.0.16.7
Locale ID: 1033
Additional Information 1: 7cba
Additional Information 2: 7cba36e683f1cee7e50f8c0f97cea9fb
Additional Information 3: cc7f
Additional Information 4: cc7ffdd5cce46f5ab60452fd7bfe4869

I have a dexsql log also. Here it is:


/* Date: 01/08/2019 Time: 8:04:35 
stmt(151407360):*/
{CALL DYNAMICS.dbo.zDP_SY07140L_1('shawn',0,1568,305,-32768,'shawn',0,1568,305,32767)}

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151408264):*/
DELETE FROM DYNAMICS.dbo.SY07140 WHERE USERID = 'shawn' AND CmdParentDictID = 0 AND CmdParentFormID = 1568 AND CmdParentCmdID = 305 AND CmdSequence >= -32768 AND CmdSequence <= 32767

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151403744):*/
BEGIN DECLARE @num int EXEC DYNAMICS.dbo.zDP_SY07140SI 'shawn', 0, 1568, 305, 0, 0, 0, 0, 0, 0, 0, 0, @num OUT SELECT @num END

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151401936):*/
BEGIN DECLARE @num int EXEC DYNAMICS.dbo.zDP_SY07140SI 'shawn', 0, 1568, 305, 1, 0, 1566, 6, 1, 0, 0, 1, @num OUT SELECT @num END

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151403744):*/
BEGIN DECLARE @num int EXEC DYNAMICS.dbo.zDP_SY07140SI 'shawn', 0, 1568, 305, 2, 0, 1566, 2, 1, 0, 0, 1, @num OUT SELECT @num END

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151408264):*/
BEGIN DECLARE @num int EXEC DYNAMICS.dbo.zDP_SY07140SI 'shawn', 0, 1568, 305, 3, 0, 1566, 5, 1, 0, 0, 1, @num OUT SELECT @num END

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151410976):*/
BEGIN DECLARE @num int EXEC DYNAMICS.dbo.zDP_SY07140SI 'shawn', 0, 1568, 305, 4, 0, 1566, 1, 1, 0, 0, 2, @num OUT SELECT @num END

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151401936):*/
BEGIN DECLARE @num int EXEC DYNAMICS.dbo.zDP_SY07140SI 'shawn', 0, 1568, 305, 5, 0, 1566, 4, 1, 0, 0, 2, @num OUT SELECT @num END

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151413688):*/
BEGIN DECLARE @num int EXEC DYNAMICS.dbo.zDP_SY07140SI 'shawn', 0, 1568, 305, 6, 0, 1566, 3, 1, 0, 0, 3, @num OUT SELECT @num END

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151404648):*/
BEGIN DECLARE @num int EXEC DYNAMICS.dbo.zDP_SY07140SI 'shawn', 0, 1568, 305, 7, 0, 1566, 7, 1, 0, 0, 3, @num OUT SELECT @num END

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151415496):*/
SELECT TOP 25 CommandTag,SectionID,MetricSequence,DEX_ROW_ID,TXTFIELD FROM ##1063303 WHERE CommandTag = 482 ORDER BY CommandTag DESC ,SectionID DESC ,MetricSequence DESC

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151410976):*/
SELECT TXTFIELD FROM ##1063303 WHERE CommandTag = 482 AND SectionID = 754 AND MetricSequence = 0

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151403744):*/
DELETE FROM ##1063303 WHERE CommandTag = 482

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151410072):*/
{ CALL DYNAMICS.dbo.zDP_SY08000SS_1 ( 'shawn' ) }

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151415496):*/
SELECT TOP 25 CommandTag,SectionID,MetricSequence,DEX_ROW_ID,TXTFIELD FROM ##1063303 WHERE CommandTag = 0 ORDER BY CommandTag DESC ,SectionID DESC ,MetricSequence DESC

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151410072):*/
{ CALL DYNAMICS.dbo.zDP_SY08000SS_1 ( 'shawn' ) }

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151401032):*/
{ CALL DYNAMICS.dbo.zDP_SY07220SS_1 ( 0, 305, 1 ) }

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151401936):*/
SELECT TOP 25 SECURITYROLEID,SECURITYROLENAME,SECURITYROLEDESC,SECROLETYPE,CRUSRID,CREATDDT,MDFUSRID,MODIFDT,DEX_ROW_ID FROM DYNAMICS.dbo.SY09100 WHERE (SECROLETYPE=1) ORDER BY SECURITYROLEID ASC

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151408264):*/
{ CALL DYNAMICS.dbo.zDP_SY10500SS_1 ( 'shawn', 4, 'POWERUSER' ) }

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151413688):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151402840):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 1586, 2 ) }

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151413688):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:35 
stmt(151402840):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 3830, 22039, 2 ) }

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151413688):*/
CREATE TABLE ##1643604 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151413688):*/
ALTER TABLE ##1643604 ADD CONSTRAINT PK##1643604 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151413688):*/
CREATE PROC ##zDP_1643604S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1643604 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151413688):*/
CREATE PROC ##zDP_1643604F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1643604 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1643604 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1643604 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151413688):*/
CREATE PROC ##zDP_1643604L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1643604 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1643604 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1643604 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151413688):*/
CREATE PROC ##zDP_1643604N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1643604 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1643604 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1643604 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151413688):*/
CREATE PROC ##zDP_1643604SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##1643604 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151413688):*/
CREATE PROC ##zDP_1643604SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##1643604 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##1643604 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:36 
SQLSTATE:(S0022) Native Err:(207) stmt(151408264):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:36 
SQLSTATE:(00000) Native Err:(207) stmt(151408264):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:36 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151416400):*/
CREATE TABLE ##2513604 (ListDictID smallint NOT NULL, ListID smallint NOT NULL, ViewID int NOT NULL, ViewAccessType smallint NOT NULL, IDValue smallint NOT NULL, USERID char(15) NOT NULL, IsEditable tinyint NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151416400):*/
ALTER TABLE ##2513604 ADD CONSTRAINT PK##2513604 PRIMARY KEY NONCLUSTERED (ListDictID, ListID, ViewID, ViewAccessType, IDValue, USERID)

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151416400):*/
CREATE PROC ##zDP_2513604S_1 (@ListDictID smallint, @ListID smallint, @ViewID int, @ViewAccessType smallint, @IDValue smallint, @USERID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 ListDictID, ListID, ViewID, ViewAccessType, IDValue, USERID, IsEditable, DEX_ROW_ID FROM .##2513604 WHERE ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND ViewAccessType = @ViewAccessType AND IDValue = @IDValue AND USERID = @USERID ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, ViewAccessType ASC, IDValue ASC, USERID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151416400):*/
CREATE PROC ##zDP_2513604F_1 (@ListDictID_RS smallint, @ListID_RS smallint, @ViewID_RS int, @ViewAccessType_RS smallint, @IDValue_RS smallint, @USERID_RS char(15), @ListDictID_RE smallint, @ListID_RE smallint, @ViewID_RE int, @ViewAccessType_RE smallint, @IDValue_RE smallint, @USERID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @ListDictID_RS IS NULL BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, ViewAccessType, IDValue, USERID, IsEditable, DEX_ROW_ID FROM .##2513604 ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, ViewAccessType ASC, IDValue ASC, USERID ASC END ELSE IF @ListDictID_RS = @ListDictID_RE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, ViewAccessType, IDValue, USERID, IsEditable, DEX_ROW_ID FROM .##2513604 WHERE ListDictID = @ListDictID_RS AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND ViewAccessType BETWEEN @ViewAccessType_RS AND @ViewAccessType_RE AND IDValue BETWEEN @IDValue_RS AND @IDValue_RE AND USERID BETWEEN @USERID_RS AND @USERID_RE ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, ViewAccessType ASC, IDValue ASC, USERID ASC END ELSE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, ViewAccessType, IDValue, USERID, IsEditable, DEX_ROW_ID FROM .##2513604 WHERE ListDictID BETWEEN @ListDictID_RS AND @ListDictID_RE AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND ViewAccessType BETWEEN @ViewAccessType_RS AND @ViewAccessType_RE AND IDValue BETWEEN @IDValue_RS AND @IDValue_RE AND USERID BETWEEN @USERID_RS AND @USERID_RE ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, ViewAccessType ASC, IDValue ASC, USERID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151416400):*/
CREATE PROC ##zDP_2513604L_1 (@ListDictID_RS smallint, @ListID_RS smallint, @ViewID_RS int, @ViewAccessType_RS smallint, @IDValue_RS smallint, @USERID_RS char(15), @ListDictID_RE smallint, @ListID_RE smallint, @ViewID_RE int, @ViewAccessType_RE smallint, @IDValue_RE smallint, @USERID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @ListDictID_RS IS NULL BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, ViewAccessType, IDValue, USERID, IsEditable, DEX_ROW_ID FROM .##2513604 ORDER BY ListDictID DESC, ListID DESC, ViewID DESC, ViewAccessType DESC, IDValue DESC, USERID DESC END ELSE IF @ListDictID_RS = @ListDictID_RE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, ViewAccessType, IDValue, USERID, IsEditable, DEX_ROW_ID FROM .##2513604 WHERE ListDictID = @ListDictID_RS AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND ViewAccessType BETWEEN @ViewAccessType_RS AND @ViewAccessType_RE AND IDValue BETWEEN @IDValue_RS AND @IDValue_RE AND USERID BETWEEN @USERID_RS AND @USERID_RE ORDER BY ListDictID DESC, ListID DESC, ViewID DESC, ViewAccessType DESC, IDValue DESC, USERID DESC END ELSE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, ViewAccessType, IDValue, USERID, IsEditable, DEX_ROW_ID FROM .##2513604 WHERE ListDictID BETWEEN @ListDictID_RS AND @ListDictID_RE AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND ViewAccessType BETWEEN @ViewAccessType_RS AND @ViewAccessType_RE AND IDValue BETWEEN @IDValue_RS AND @IDValue_RE AND USERID BETWEEN @USERID_RS AND @USERID_RE ORDER BY ListDictID DESC, ListID DESC, ViewID DESC, ViewAccessType DESC, IDValue DESC, USERID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151416400):*/
CREATE PROC ##zDP_2513604N_1 (@BS int, @ListDictID smallint, @ListID smallint, @ViewID int, @ViewAccessType smallint, @IDValue smallint, @USERID char(15), @ListDictID_RS smallint, @ListID_RS smallint, @ViewID_RS int, @ViewAccessType_RS smallint, @IDValue_RS smallint, @USERID_RS char(15), @ListDictID_RE smallint, @ListID_RE smallint, @ViewID_RE int, @ViewAccessType_RE smallint, @IDValue_RE smallint, @USERID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @ListDictID_RS IS NULL BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, ViewAccessType, IDValue, USERID, IsEditable, DEX_ROW_ID FROM .##2513604 WHERE ( ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND ViewAccessType = @ViewAccessType AND IDValue = @IDValue AND USERID > @USERID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND ViewAccessType = @ViewAccessType AND IDValue > @IDValue OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND ViewAccessType > @ViewAccessType OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID > @ViewID OR ListDictID = @ListDictID AND ListID > @ListID OR ListDictID > @ListDictID ) ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, ViewAccessType ASC, IDValue ASC, USERID ASC END ELSE IF @ListDictID_RS = @ListDictID_RE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, ViewAccessType, IDValue, USERID, IsEditable, DEX_ROW_ID FROM .##2513604 WHERE ListDictID = @ListDictID_RS AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND ViewAccessType BETWEEN @ViewAccessType_RS AND @ViewAccessType_RE AND IDValue BETWEEN @IDValue_RS AND @IDValue_RE AND USERID BETWEEN @USERID_RS AND @USERID_RE AND ( ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND ViewAccessType = @ViewAccessType AND IDValue = @IDValue AND USERID > @USERID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND ViewAccessType = @ViewAccessType AND IDValue > @IDValue OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND ViewAccessType > @ViewAccessType OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID > @ViewID OR ListDictID = @ListDictID AND ListID > @ListID OR ListDictID > @ListDictID ) ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, ViewAccessType ASC, IDValue ASC, USERID ASC END ELSE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, ViewAccessType, IDValue, USERID, IsEditable, DEX_ROW_ID FROM .##2513604 WHERE ListDictID BETWEEN @ListDictID_RS AND @ListDictID_RE AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND ViewAccessType BETWEEN @ViewAccessType_RS AND @ViewAccessType_RE AND IDValue BETWEEN @IDValue_RS AND @IDValue_RE AND USERID BETWEEN @USERID_RS AND @USERID_RE AND ( ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND ViewAccessType = @ViewAccessType AND IDValue = @IDValue AND USERID > @USERID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND ViewAccessType = @ViewAccessType AND IDValue > @IDValue OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND ViewAccessType > @ViewAccessType OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID > @ViewID OR ListDictID = @ListDictID AND ListID > @ListID OR ListDictID > @ListDictID ) ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, ViewAccessType ASC, IDValue ASC, USERID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151416400):*/
CREATE PROC ##zDP_2513604SI (@ListDictID smallint, @ListID smallint, @ViewID int, @ViewAccessType smallint, @IDValue smallint, @USERID char(15), @IsEditable tinyint, @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##2513604 (ListDictID, ListID, ViewID, ViewAccessType, IDValue, USERID, IsEditable) VALUES ( @ListDictID, @ListID, @ViewID, @ViewAccessType, @IDValue, @USERID, @IsEditable) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151416400):*/
CREATE PROC ##zDP_2513604SD (@ListDictID smallint, @ListID smallint, @ViewID int, @ViewAccessType smallint, @IDValue smallint, @USERID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##2513604 WHERE ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND ViewAccessType = @ViewAccessType AND IDValue = @IDValue AND USERID = @USERID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##2513604 WHERE ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND ViewAccessType = @ViewAccessType AND IDValue = @IDValue AND USERID = @USERID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:36 
SQLSTATE:(S0022) Native Err:(207) stmt(151406456):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:36 
SQLSTATE:(00000) Native Err:(207) stmt(151406456):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:36 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151403744):*/
CREATE TABLE ##0503604 (ListDictID smallint NOT NULL, ListID smallint NOT NULL, ViewID int NOT NULL, CmdParentDictID smallint NOT NULL, CmdParentFormID smallint NOT NULL, CmdParentCmdID smallint NOT NULL, CmdSequence smallint NOT NULL, CmdDictID smallint NOT NULL, CmdFormID smallint NOT NULL, CmdID smallint NOT NULL, Priority smallint NOT NULL, ButtonSize smallint NOT NULL, CmdCaption char(79) NOT NULL, Visible tinyint NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151403744):*/
ALTER TABLE ##0503604 ADD CONSTRAINT PK##0503604 PRIMARY KEY NONCLUSTERED (ListDictID, ListID, ViewID, CmdParentDictID, CmdParentFormID, CmdParentCmdID, CmdSequence)

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151403744):*/
CREATE PROC ##zDP_0503604S_1 (@ListDictID smallint, @ListID smallint, @ViewID int, @CmdParentDictID smallint, @CmdParentFormID smallint, @CmdParentCmdID smallint, @CmdSequence smallint) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 ListDictID, ListID, ViewID, CmdParentDictID, CmdParentFormID, CmdParentCmdID, CmdSequence, CmdDictID, CmdFormID, CmdID, Priority, ButtonSize, CmdCaption, Visible, DEX_ROW_ID FROM .##0503604 WHERE ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND CmdParentDictID = @CmdParentDictID AND CmdParentFormID = @CmdParentFormID AND CmdParentCmdID = @CmdParentCmdID AND CmdSequence = @CmdSequence ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, CmdParentDictID ASC, CmdParentFormID ASC, CmdParentCmdID ASC, CmdSequence ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151403744):*/
CREATE PROC ##zDP_0503604F_1 (@ListDictID_RS smallint, @ListID_RS smallint, @ViewID_RS int, @CmdParentDictID_RS smallint, @CmdParentFormID_RS smallint, @CmdParentCmdID_RS smallint, @CmdSequence_RS smallint, @ListDictID_RE smallint, @ListID_RE smallint, @ViewID_RE int, @CmdParentDictID_RE smallint, @CmdParentFormID_RE smallint, @CmdParentCmdID_RE smallint, @CmdSequence_RE smallint) AS /* 18.00.0010.000 */ set nocount on IF @ListDictID_RS IS NULL BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, CmdParentDictID, CmdParentFormID, CmdParentCmdID, CmdSequence, CmdDictID, CmdFormID, CmdID, Priority, ButtonSize, CmdCaption, Visible, DEX_ROW_ID FROM .##0503604 ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, CmdParentDictID ASC, CmdParentFormID ASC, CmdParentCmdID ASC, CmdSequence ASC END ELSE IF @ListDictID_RS = @ListDictID_RE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, CmdParentDictID, CmdParentFormID, CmdParentCmdID, CmdSequence, CmdDictID, CmdFormID, CmdID, Priority, ButtonSize, CmdCaption, Visible, DEX_ROW_ID FROM .##0503604 WHERE ListDictID = @ListDictID_RS AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND CmdParentDictID BETWEEN @CmdParentDictID_RS AND @CmdParentDictID_RE AND CmdParentFormID BETWEEN @CmdParentFormID_RS AND @CmdParentFormID_RE AND CmdParentCmdID BETWEEN @CmdParentCmdID_RS AND @CmdParentCmdID_RE AND CmdSequence BETWEEN @CmdSequence_RS AND @CmdSequence_RE ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, CmdParentDictID ASC, CmdParentFormID ASC, CmdParentCmdID ASC, CmdSequence ASC END ELSE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, CmdParentDictID, CmdParentFormID, CmdParentCmdID, CmdSequence, CmdDictID, CmdFormID, CmdID, Priority, ButtonSize, CmdCaption, Visible, DEX_ROW_ID FROM .##0503604 WHERE ListDictID BETWEEN @ListDictID_RS AND @ListDictID_RE AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND CmdParentDictID BETWEEN @CmdParentDictID_RS AND @CmdParentDictID_RE AND CmdParentFormID BETWEEN @CmdParentFormID_RS AND @CmdParentFormID_RE AND CmdParentCmdID BETWEEN @CmdParentCmdID_RS AND @CmdParentCmdID_RE AND CmdSequence BETWEEN @CmdSequence_RS AND @CmdSequence_RE ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, CmdParentDictID ASC, CmdParentFormID ASC, CmdParentCmdID ASC, CmdSequence ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151403744):*/
CREATE PROC ##zDP_0503604L_1 (@ListDictID_RS smallint, @ListID_RS smallint, @ViewID_RS int, @CmdParentDictID_RS smallint, @CmdParentFormID_RS smallint, @CmdParentCmdID_RS smallint, @CmdSequence_RS smallint, @ListDictID_RE smallint, @ListID_RE smallint, @ViewID_RE int, @CmdParentDictID_RE smallint, @CmdParentFormID_RE smallint, @CmdParentCmdID_RE smallint, @CmdSequence_RE smallint) AS /* 18.00.0010.000 */ set nocount on IF @ListDictID_RS IS NULL BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, CmdParentDictID, CmdParentFormID, CmdParentCmdID, CmdSequence, CmdDictID, CmdFormID, CmdID, Priority, ButtonSize, CmdCaption, Visible, DEX_ROW_ID FROM .##0503604 ORDER BY ListDictID DESC, ListID DESC, ViewID DESC, CmdParentDictID DESC, CmdParentFormID DESC, CmdParentCmdID DESC, CmdSequence DESC END ELSE IF @ListDictID_RS = @ListDictID_RE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, CmdParentDictID, CmdParentFormID, CmdParentCmdID, CmdSequence, CmdDictID, CmdFormID, CmdID, Priority, ButtonSize, CmdCaption, Visible, DEX_ROW_ID FROM .##0503604 WHERE ListDictID = @ListDictID_RS AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND CmdParentDictID BETWEEN @CmdParentDictID_RS AND @CmdParentDictID_RE AND CmdParentFormID BETWEEN @CmdParentFormID_RS AND @CmdParentFormID_RE AND CmdParentCmdID BETWEEN @CmdParentCmdID_RS AND @CmdParentCmdID_RE AND CmdSequence BETWEEN @CmdSequence_RS AND @CmdSequence_RE ORDER BY ListDictID DESC, ListID DESC, ViewID DESC, CmdParentDictID DESC, CmdParentFormID DESC, CmdParentCmdID DESC, CmdSequence DESC END ELSE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, CmdParentDictID, CmdParentFormID, CmdParentCmdID, CmdSequence, CmdDictID, CmdFormID, CmdID, Priority, ButtonSize, CmdCaption, Visible, DEX_ROW_ID FROM .##0503604 WHERE ListDictID BETWEEN @ListDictID_RS AND @ListDictID_RE AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND CmdParentDictID BETWEEN @CmdParentDictID_RS AND @CmdParentDictID_RE AND CmdParentFormID BETWEEN @CmdParentFormID_RS AND @CmdParentFormID_RE AND CmdParentCmdID BETWEEN @CmdParentCmdID_RS AND @CmdParentCmdID_RE AND CmdSequence BETWEEN @CmdSequence_RS AND @CmdSequence_RE ORDER BY ListDictID DESC, ListID DESC, ViewID DESC, CmdParentDictID DESC, CmdParentFormID DESC, CmdParentCmdID DESC, CmdSequence DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151403744):*/
CREATE PROC ##zDP_0503604N_1 (@BS int, @ListDictID smallint, @ListID smallint, @ViewID int, @CmdParentDictID smallint, @CmdParentFormID smallint, @CmdParentCmdID smallint, @CmdSequence smallint, @ListDictID_RS smallint, @ListID_RS smallint, @ViewID_RS int, @CmdParentDictID_RS smallint, @CmdParentFormID_RS smallint, @CmdParentCmdID_RS smallint, @CmdSequence_RS smallint, @ListDictID_RE smallint, @ListID_RE smallint, @ViewID_RE int, @CmdParentDictID_RE smallint, @CmdParentFormID_RE smallint, @CmdParentCmdID_RE smallint, @CmdSequence_RE smallint) AS /* 18.00.0010.000 */ set nocount on IF @ListDictID_RS IS NULL BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, CmdParentDictID, CmdParentFormID, CmdParentCmdID, CmdSequence, CmdDictID, CmdFormID, CmdID, Priority, ButtonSize, CmdCaption, Visible, DEX_ROW_ID FROM .##0503604 WHERE ( ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND CmdParentDictID = @CmdParentDictID AND CmdParentFormID = @CmdParentFormID AND CmdParentCmdID = @CmdParentCmdID AND CmdSequence > @CmdSequence OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND CmdParentDictID = @CmdParentDictID AND CmdParentFormID = @CmdParentFormID AND CmdParentCmdID > @CmdParentCmdID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND CmdParentDictID = @CmdParentDictID AND CmdParentFormID > @CmdParentFormID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND CmdParentDictID > @CmdParentDictID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID > @ViewID OR ListDictID = @ListDictID AND ListID > @ListID OR ListDictID > @ListDictID ) ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, CmdParentDictID ASC, CmdParentFormID ASC, CmdParentCmdID ASC, CmdSequence ASC END ELSE IF @ListDictID_RS = @ListDictID_RE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, CmdParentDictID, CmdParentFormID, CmdParentCmdID, CmdSequence, CmdDictID, CmdFormID, CmdID, Priority, ButtonSize, CmdCaption, Visible, DEX_ROW_ID FROM .##0503604 WHERE ListDictID = @ListDictID_RS AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND CmdParentDictID BETWEEN @CmdParentDictID_RS AND @CmdParentDictID_RE AND CmdParentFormID BETWEEN @CmdParentFormID_RS AND @CmdParentFormID_RE AND CmdParentCmdID BETWEEN @CmdParentCmdID_RS AND @CmdParentCmdID_RE AND CmdSequence BETWEEN @CmdSequence_RS AND @CmdSequence_RE AND ( ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND CmdParentDictID = @CmdParentDictID AND CmdParentFormID = @CmdParentFormID AND CmdParentCmdID = @CmdParentCmdID AND CmdSequence > @CmdSequence OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND CmdParentDictID = @CmdParentDictID AND CmdParentFormID = @CmdParentFormID AND CmdParentCmdID > @CmdParentCmdID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND CmdParentDictID = @CmdParentDictID AND CmdParentFormID > @CmdParentFormID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND CmdParentDictID > @CmdParentDictID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID > @ViewID OR ListDictID = @ListDictID AND ListID > @ListID OR ListDictID > @ListDictID ) ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, CmdParentDictID ASC, CmdParentFormID ASC, CmdParentCmdID ASC, CmdSequence ASC END ELSE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, CmdParentDictID, CmdParentFormID, CmdParentCmdID, CmdSequence, CmdDictID, CmdFormID, CmdID, Priority, ButtonSize, CmdCaption, Visible, DEX_ROW_ID FROM .##0503604 WHERE ListDictID BETWEEN @ListDictID_RS AND @ListDictID_RE AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND CmdParentDictID BETWEEN @CmdParentDictID_RS AND @CmdParentDictID_RE AND CmdParentFormID BETWEEN @CmdParentFormID_RS AND @CmdParentFormID_RE AND CmdParentCmdID BETWEEN @CmdParentCmdID_RS AND @CmdParentCmdID_RE AND CmdSequence BETWEEN @CmdSequence_RS AND @CmdSequence_RE AND ( ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND CmdParentDictID = @CmdParentDictID AND CmdParentFormID = @CmdParentFormID AND CmdParentCmdID = @CmdParentCmdID AND CmdSequence > @CmdSequence OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND CmdParentDictID = @CmdParentDictID AND CmdParentFormID = @CmdParentFormID AND CmdParentCmdID > @CmdParentCmdID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND CmdParentDictID = @CmdParentDictID AND CmdParentFormID > @CmdParentFormID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND CmdParentDictID > @CmdParentDictID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID > @ViewID OR ListDictID = @ListDictID AND ListID > @ListID OR ListDictID > @ListDictID ) ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, CmdParentDictID ASC, CmdParentFormID ASC, CmdParentCmdID ASC, CmdSequence ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151403744):*/
CREATE PROC ##zDP_0503604SI (@ListDictID smallint, @ListID smallint, @ViewID int, @CmdParentDictID smallint, @CmdParentFormID smallint, @CmdParentCmdID smallint, @CmdSequence smallint, @CmdDictID smallint, @CmdFormID smallint, @CmdID smallint, @Priority smallint, @ButtonSize smallint, @CmdCaption char(79), @Visible tinyint, @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##0503604 (ListDictID, ListID, ViewID, CmdParentDictID, CmdParentFormID, CmdParentCmdID, CmdSequence, CmdDictID, CmdFormID, CmdID, Priority, ButtonSize, CmdCaption, Visible) VALUES ( @ListDictID, @ListID, @ViewID, @CmdParentDictID, @CmdParentFormID, @CmdParentCmdID, @CmdSequence, @CmdDictID, @CmdFormID, @CmdID, @Priority, @ButtonSize, @CmdCaption, @Visible) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151403744):*/
CREATE PROC ##zDP_0503604SD (@ListDictID smallint, @ListID smallint, @ViewID int, @CmdParentDictID smallint, @CmdParentFormID smallint, @CmdParentCmdID smallint, @CmdSequence smallint, @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##0503604 WHERE ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND CmdParentDictID = @CmdParentDictID AND CmdParentFormID = @CmdParentFormID AND CmdParentCmdID = @CmdParentCmdID AND CmdSequence = @CmdSequence AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##0503604 WHERE ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND CmdParentDictID = @CmdParentDictID AND CmdParentFormID = @CmdParentFormID AND CmdParentCmdID = @CmdParentCmdID AND CmdSequence = @CmdSequence SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:36 
SQLSTATE:(S0022) Native Err:(207) stmt(151404648):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:36 
SQLSTATE:(00000) Native Err:(207) stmt(151404648):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:36 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151452704):*/
CREATE TABLE ##1113604 (ListDictID smallint NOT NULL, ListID smallint NOT NULL, ViewID int NOT NULL, USERID char(15) NOT NULL, ColSequence smallint NOT NULL, ColFieldID smallint NOT NULL, ColArrayIndex smallint NOT NULL, ColFormatFldDictID smallint NOT NULL, ColFormatFldFieldID smallint NOT NULL, ColVisible tinyint NOT NULL, ColWidth smallint NOT NULL, ColSortSequence smallint NOT NULL, ColSortOrder smallint NOT NULL, FilterTokenID int NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151452704):*/
ALTER TABLE ##1113604 ADD CONSTRAINT PK##1113604 PRIMARY KEY NONCLUSTERED (ListDictID, ListID, ViewID, USERID, ColSequence)

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151452704):*/
CREATE UNIQUE INDEX AK2##1113604 ON ##1113604 (ListDictID, ListID, ViewID, USERID, ColSortSequence, DEX_ROW_ID)

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151452704):*/
CREATE PROC ##zDP_1113604S_1 (@ListDictID smallint, @ListID smallint, @ViewID int, @USERID char(15), @ColSequence smallint) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 WHERE ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID = @USERID AND ColSequence = @ColSequence ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, USERID ASC, ColSequence ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151452704):*/
CREATE PROC ##zDP_1113604F_1 (@ListDictID_RS smallint, @ListID_RS smallint, @ViewID_RS int, @USERID_RS char(15), @ColSequence_RS smallint, @ListDictID_RE smallint, @ListID_RE smallint, @ViewID_RE int, @USERID_RE char(15), @ColSequence_RE smallint) AS /* 18.00.0010.000 */ set nocount on IF @ListDictID_RS IS NULL BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, USERID ASC, ColSequence ASC END ELSE IF @ListDictID_RS = @ListDictID_RE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 WHERE ListDictID = @ListDictID_RS AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND USERID BETWEEN @USERID_RS AND @USERID_RE AND ColSequence BETWEEN @ColSequence_RS AND @ColSequence_RE ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, USERID ASC, ColSequence ASC END ELSE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 WHERE ListDictID BETWEEN @ListDictID_RS AND @ListDictID_RE AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND USERID BETWEEN @USERID_RS AND @USERID_RE AND ColSequence BETWEEN @ColSequence_RS AND @ColSequence_RE ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, USERID ASC, ColSequence ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151452704):*/
CREATE PROC ##zDP_1113604L_1 (@ListDictID_RS smallint, @ListID_RS smallint, @ViewID_RS int, @USERID_RS char(15), @ColSequence_RS smallint, @ListDictID_RE smallint, @ListID_RE smallint, @ViewID_RE int, @USERID_RE char(15), @ColSequence_RE smallint) AS /* 18.00.0010.000 */ set nocount on IF @ListDictID_RS IS NULL BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 ORDER BY ListDictID DESC, ListID DESC, ViewID DESC, USERID DESC, ColSequence DESC END ELSE IF @ListDictID_RS = @ListDictID_RE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 WHERE ListDictID = @ListDictID_RS AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND USERID BETWEEN @USERID_RS AND @USERID_RE AND ColSequence BETWEEN @ColSequence_RS AND @ColSequence_RE ORDER BY ListDictID DESC, ListID DESC, ViewID DESC, USERID DESC, ColSequence DESC END ELSE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 WHERE ListDictID BETWEEN @ListDictID_RS AND @ListDictID_RE AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND USERID BETWEEN @USERID_RS AND @USERID_RE AND ColSequence BETWEEN @ColSequence_RS AND @ColSequence_RE ORDER BY ListDictID DESC, ListID DESC, ViewID DESC, USERID DESC, ColSequence DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151452704):*/
CREATE PROC ##zDP_1113604N_1 (@BS int, @ListDictID smallint, @ListID smallint, @ViewID int, @USERID char(15), @ColSequence smallint, @ListDictID_RS smallint, @ListID_RS smallint, @ViewID_RS int, @USERID_RS char(15), @ColSequence_RS smallint, @ListDictID_RE smallint, @ListID_RE smallint, @ViewID_RE int, @USERID_RE char(15), @ColSequence_RE smallint) AS /* 18.00.0010.000 */ set nocount on IF @ListDictID_RS IS NULL BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 WHERE ( ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID = @USERID AND ColSequence > @ColSequence OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID > @USERID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID > @ViewID OR ListDictID = @ListDictID AND ListID > @ListID OR ListDictID > @ListDictID ) ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, USERID ASC, ColSequence ASC END ELSE IF @ListDictID_RS = @ListDictID_RE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 WHERE ListDictID = @ListDictID_RS AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND USERID BETWEEN @USERID_RS AND @USERID_RE AND ColSequence BETWEEN @ColSequence_RS AND @ColSequence_RE AND ( ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID = @USERID AND ColSequence > @ColSequence OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID > @USERID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID > @ViewID OR ListDictID = @ListDictID AND ListID > @ListID OR ListDictID > @ListDictID ) ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, USERID ASC, ColSequence ASC END ELSE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 WHERE ListDictID BETWEEN @ListDictID_RS AND @ListDictID_RE AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND USERID BETWEEN @USERID_RS AND @USERID_RE AND ColSequence BETWEEN @ColSequence_RS AND @ColSequence_RE AND ( ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID = @USERID AND ColSequence > @ColSequence OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID > @USERID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID > @ViewID OR ListDictID = @ListDictID AND ListID > @ListID OR ListDictID > @ListDictID ) ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, USERID ASC, ColSequence ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151452704):*/
CREATE PROC ##zDP_1113604S_2 (@ListDictID smallint, @ListID smallint, @ViewID int, @USERID char(15), @ColSortSequence smallint) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 WHERE ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID = @USERID AND ColSortSequence = @ColSortSequence ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, USERID ASC, ColSortSequence ASC, DEX_ROW_ID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151452704):*/
CREATE PROC ##zDP_1113604F_2 (@ListDictID_RS smallint, @ListID_RS smallint, @ViewID_RS int, @USERID_RS char(15), @ColSortSequence_RS smallint, @ListDictID_RE smallint, @ListID_RE smallint, @ViewID_RE int, @USERID_RE char(15), @ColSortSequence_RE smallint) AS /* 18.00.0010.000 */ set nocount on IF @ListDictID_RS IS NULL BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, USERID ASC, ColSortSequence ASC, DEX_ROW_ID ASC END ELSE IF @ListDictID_RS = @ListDictID_RE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 WHERE ListDictID = @ListDictID_RS AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND USERID BETWEEN @USERID_RS AND @USERID_RE AND ColSortSequence BETWEEN @ColSortSequence_RS AND @ColSortSequence_RE ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, USERID ASC, ColSortSequence ASC, DEX_ROW_ID ASC END ELSE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 WHERE ListDictID BETWEEN @ListDictID_RS AND @ListDictID_RE AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND USERID BETWEEN @USERID_RS AND @USERID_RE AND ColSortSequence BETWEEN @ColSortSequence_RS AND @ColSortSequence_RE ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, USERID ASC, ColSortSequence ASC, DEX_ROW_ID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151452704):*/
CREATE PROC ##zDP_1113604L_2 (@ListDictID_RS smallint, @ListID_RS smallint, @ViewID_RS int, @USERID_RS char(15), @ColSortSequence_RS smallint, @ListDictID_RE smallint, @ListID_RE smallint, @ViewID_RE int, @USERID_RE char(15), @ColSortSequence_RE smallint) AS /* 18.00.0010.000 */ set nocount on IF @ListDictID_RS IS NULL BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 ORDER BY ListDictID DESC, ListID DESC, ViewID DESC, USERID DESC, ColSortSequence DESC, DEX_ROW_ID DESC END ELSE IF @ListDictID_RS = @ListDictID_RE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 WHERE ListDictID = @ListDictID_RS AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND USERID BETWEEN @USERID_RS AND @USERID_RE AND ColSortSequence BETWEEN @ColSortSequence_RS AND @ColSortSequence_RE ORDER BY ListDictID DESC, ListID DESC, ViewID DESC, USERID DESC, ColSortSequence DESC, DEX_ROW_ID DESC END ELSE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 WHERE ListDictID BETWEEN @ListDictID_RS AND @ListDictID_RE AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND USERID BETWEEN @USERID_RS AND @USERID_RE AND ColSortSequence BETWEEN @ColSortSequence_RS AND @ColSortSequence_RE ORDER BY ListDictID DESC, ListID DESC, ViewID DESC, USERID DESC, ColSortSequence DESC, DEX_ROW_ID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151452704):*/
CREATE PROC ##zDP_1113604UN_2 (@BS int, @ListDictID smallint, @ListID smallint, @ViewID int, @USERID char(15), @ColSortSequence smallint, @ListDictID_RS smallint, @ListID_RS smallint, @ViewID_RS int, @USERID_RS char(15), @ColSortSequence_RS smallint, @ListDictID_RE smallint, @ListID_RE smallint, @ViewID_RE int, @USERID_RE char(15), @ColSortSequence_RE smallint) AS /* 18.00.0010.000 */ set nocount on IF @ListDictID_RS IS NULL BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 WHERE ( ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID = @USERID AND ColSortSequence > @ColSortSequence OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID > @USERID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID > @ViewID OR ListDictID = @ListDictID AND ListID > @ListID OR ListDictID > @ListDictID ) ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, USERID ASC, ColSortSequence ASC, DEX_ROW_ID ASC END ELSE IF @ListDictID_RS = @ListDictID_RE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 WHERE ListDictID = @ListDictID_RS AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND USERID BETWEEN @USERID_RS AND @USERID_RE AND ColSortSequence BETWEEN @ColSortSequence_RS AND @ColSortSequence_RE AND ( ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID = @USERID AND ColSortSequence > @ColSortSequence OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID > @USERID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID > @ViewID OR ListDictID = @ListDictID AND ListID > @ListID OR ListDictID > @ListDictID ) ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, USERID ASC, ColSortSequence ASC, DEX_ROW_ID ASC END ELSE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 WHERE ListDictID BETWEEN @ListDictID_RS AND @ListDictID_RE AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND USERID BETWEEN @USERID_RS AND @USERID_RE AND ColSortSequence BETWEEN @ColSortSequence_RS AND @ColSortSequence_RE AND ( ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID = @USERID AND ColSortSequence > @ColSortSequence OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID > @USERID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID > @ViewID OR ListDictID = @ListDictID AND ListID > @ListID OR ListDictID > @ListDictID ) ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, USERID ASC, ColSortSequence ASC, DEX_ROW_ID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151452704):*/
CREATE PROC ##zDP_1113604N_2 (@BS int, @ListDictID smallint, @ListID smallint, @ViewID int, @USERID char(15), @ColSortSequence smallint, @DEX_ROW_ID int, @ListDictID_RS smallint, @ListID_RS smallint, @ViewID_RS int, @USERID_RS char(15), @ColSortSequence_RS smallint, @ListDictID_RE smallint, @ListID_RE smallint, @ViewID_RE int, @USERID_RE char(15), @ColSortSequence_RE smallint) AS /* 18.00.0010.000 */ set nocount on IF @ListDictID_RS IS NULL BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 WHERE ( ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID = @USERID AND ColSortSequence = @ColSortSequence AND DEX_ROW_ID > @DEX_ROW_ID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID = @USERID AND ColSortSequence > @ColSortSequence OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID > @USERID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID > @ViewID OR ListDictID = @ListDictID AND ListID > @ListID OR ListDictID > @ListDictID ) ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, USERID ASC, ColSortSequence ASC, DEX_ROW_ID ASC END ELSE IF @ListDictID_RS = @ListDictID_RE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 WHERE ListDictID = @ListDictID_RS AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND USERID BETWEEN @USERID_RS AND @USERID_RE AND ColSortSequence BETWEEN @ColSortSequence_RS AND @ColSortSequence_RE AND ( ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID = @USERID AND ColSortSequence = @ColSortSequence AND DEX_ROW_ID > @DEX_ROW_ID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID = @USERID AND ColSortSequence > @ColSortSequence OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID > @USERID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID > @ViewID OR ListDictID = @ListDictID AND ListID > @ListID OR ListDictID > @ListDictID ) ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, USERID ASC, ColSortSequence ASC, DEX_ROW_ID ASC END ELSE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID, DEX_ROW_ID FROM .##1113604 WHERE ListDictID BETWEEN @ListDictID_RS AND @ListDictID_RE AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND USERID BETWEEN @USERID_RS AND @USERID_RE AND ColSortSequence BETWEEN @ColSortSequence_RS AND @ColSortSequence_RE AND ( ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID = @USERID AND ColSortSequence = @ColSortSequence AND DEX_ROW_ID > @DEX_ROW_ID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID = @USERID AND ColSortSequence > @ColSortSequence OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID > @USERID OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID > @ViewID OR ListDictID = @ListDictID AND ListID > @ListID OR ListDictID > @ListDictID ) ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, USERID ASC, ColSortSequence ASC, DEX_ROW_ID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151452704):*/
CREATE PROC ##zDP_1113604SI (@ListDictID smallint, @ListID smallint, @ViewID int, @USERID char(15), @ColSequence smallint, @ColFieldID smallint, @ColArrayIndex smallint, @ColFormatFldDictID smallint, @ColFormatFldFieldID smallint, @ColVisible tinyint, @ColWidth smallint, @ColSortSequence smallint, @ColSortOrder smallint, @FilterTokenID int, @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##1113604 (ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID) VALUES ( @ListDictID, @ListID, @ViewID, @USERID, @ColSequence, @ColFieldID, @ColArrayIndex, @ColFormatFldDictID, @ColFormatFldFieldID, @ColVisible, @ColWidth, @ColSortSequence, @ColSortOrder, @FilterTokenID) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151452704):*/
CREATE PROC ##zDP_1113604SD (@ListDictID smallint, @ListID smallint, @ViewID int, @USERID char(15), @ColSequence smallint, @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##1113604 WHERE ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID = @USERID AND ColSequence = @ColSequence AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##1113604 WHERE ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND USERID = @USERID AND ColSequence = @ColSequence SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:36 
SQLSTATE:(S0022) Native Err:(207) stmt(151437336):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:36 
SQLSTATE:(00000) Native Err:(207) stmt(151437336):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:36 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151451800):*/
CREATE TABLE ##2013604 (ListDictID smallint NOT NULL, ListID smallint NOT NULL, ViewID int NOT NULL, SEQNUMBR int NOT NULL, URL char(255) NOT NULL, SRS_Report_Name char(255) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151451800):*/
ALTER TABLE ##2013604 ADD CONSTRAINT PK##2013604 PRIMARY KEY NONCLUSTERED (ListDictID, ListID, ViewID, SEQNUMBR)

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151451800):*/
CREATE PROC ##zDP_2013604S_1 (@ListDictID smallint, @ListID smallint, @ViewID int, @SEQNUMBR int) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 ListDictID, ListID, ViewID, SEQNUMBR, URL, SRS_Report_Name, DEX_ROW_ID FROM .##2013604 WHERE ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND SEQNUMBR = @SEQNUMBR ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, SEQNUMBR ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151451800):*/
CREATE PROC ##zDP_2013604F_1 (@ListDictID_RS smallint, @ListID_RS smallint, @ViewID_RS int, @SEQNUMBR_RS int, @ListDictID_RE smallint, @ListID_RE smallint, @ViewID_RE int, @SEQNUMBR_RE int) AS /* 18.00.0010.000 */ set nocount on IF @ListDictID_RS IS NULL BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, SEQNUMBR, URL, SRS_Report_Name, DEX_ROW_ID FROM .##2013604 ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, SEQNUMBR ASC END ELSE IF @ListDictID_RS = @ListDictID_RE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, SEQNUMBR, URL, SRS_Report_Name, DEX_ROW_ID FROM .##2013604 WHERE ListDictID = @ListDictID_RS AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND SEQNUMBR BETWEEN @SEQNUMBR_RS AND @SEQNUMBR_RE ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, SEQNUMBR ASC END ELSE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, SEQNUMBR, URL, SRS_Report_Name, DEX_ROW_ID FROM .##2013604 WHERE ListDictID BETWEEN @ListDictID_RS AND @ListDictID_RE AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND SEQNUMBR BETWEEN @SEQNUMBR_RS AND @SEQNUMBR_RE ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, SEQNUMBR ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151451800):*/
CREATE PROC ##zDP_2013604L_1 (@ListDictID_RS smallint, @ListID_RS smallint, @ViewID_RS int, @SEQNUMBR_RS int, @ListDictID_RE smallint, @ListID_RE smallint, @ViewID_RE int, @SEQNUMBR_RE int) AS /* 18.00.0010.000 */ set nocount on IF @ListDictID_RS IS NULL BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, SEQNUMBR, URL, SRS_Report_Name, DEX_ROW_ID FROM .##2013604 ORDER BY ListDictID DESC, ListID DESC, ViewID DESC, SEQNUMBR DESC END ELSE IF @ListDictID_RS = @ListDictID_RE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, SEQNUMBR, URL, SRS_Report_Name, DEX_ROW_ID FROM .##2013604 WHERE ListDictID = @ListDictID_RS AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND SEQNUMBR BETWEEN @SEQNUMBR_RS AND @SEQNUMBR_RE ORDER BY ListDictID DESC, ListID DESC, ViewID DESC, SEQNUMBR DESC END ELSE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, SEQNUMBR, URL, SRS_Report_Name, DEX_ROW_ID FROM .##2013604 WHERE ListDictID BETWEEN @ListDictID_RS AND @ListDictID_RE AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND SEQNUMBR BETWEEN @SEQNUMBR_RS AND @SEQNUMBR_RE ORDER BY ListDictID DESC, ListID DESC, ViewID DESC, SEQNUMBR DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151451800):*/
CREATE PROC ##zDP_2013604N_1 (@BS int, @ListDictID smallint, @ListID smallint, @ViewID int, @SEQNUMBR int, @ListDictID_RS smallint, @ListID_RS smallint, @ViewID_RS int, @SEQNUMBR_RS int, @ListDictID_RE smallint, @ListID_RE smallint, @ViewID_RE int, @SEQNUMBR_RE int) AS /* 18.00.0010.000 */ set nocount on IF @ListDictID_RS IS NULL BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, SEQNUMBR, URL, SRS_Report_Name, DEX_ROW_ID FROM .##2013604 WHERE ( ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND SEQNUMBR > @SEQNUMBR OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID > @ViewID OR ListDictID = @ListDictID AND ListID > @ListID OR ListDictID > @ListDictID ) ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, SEQNUMBR ASC END ELSE IF @ListDictID_RS = @ListDictID_RE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, SEQNUMBR, URL, SRS_Report_Name, DEX_ROW_ID FROM .##2013604 WHERE ListDictID = @ListDictID_RS AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND SEQNUMBR BETWEEN @SEQNUMBR_RS AND @SEQNUMBR_RE AND ( ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND SEQNUMBR > @SEQNUMBR OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID > @ViewID OR ListDictID = @ListDictID AND ListID > @ListID OR ListDictID > @ListDictID ) ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, SEQNUMBR ASC END ELSE BEGIN SELECT TOP 25 ListDictID, ListID, ViewID, SEQNUMBR, URL, SRS_Report_Name, DEX_ROW_ID FROM .##2013604 WHERE ListDictID BETWEEN @ListDictID_RS AND @ListDictID_RE AND ListID BETWEEN @ListID_RS AND @ListID_RE AND ViewID BETWEEN @ViewID_RS AND @ViewID_RE AND SEQNUMBR BETWEEN @SEQNUMBR_RS AND @SEQNUMBR_RE AND ( ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND SEQNUMBR > @SEQNUMBR OR ListDictID = @ListDictID AND ListID = @ListID AND ViewID > @ViewID OR ListDictID = @ListDictID AND ListID > @ListID OR ListDictID > @ListDictID ) ORDER BY ListDictID ASC, ListID ASC, ViewID ASC, SEQNUMBR ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151451800):*/
CREATE PROC ##zDP_2013604SI (@ListDictID smallint, @ListID smallint, @ViewID int, @SEQNUMBR int, @URL char(255), @SRS_Report_Name char(255), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##2013604 (ListDictID, ListID, ViewID, SEQNUMBR, URL, SRS_Report_Name) VALUES ( @ListDictID, @ListID, @ViewID, @SEQNUMBR, @URL, @SRS_Report_Name) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151451800):*/
CREATE PROC ##zDP_2013604SD (@ListDictID smallint, @ListID smallint, @ViewID int, @SEQNUMBR int, @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##2013604 WHERE ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND SEQNUMBR = @SEQNUMBR AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##2013604 WHERE ListDictID = @ListDictID AND ListID = @ListID AND ViewID = @ViewID AND SEQNUMBR = @SEQNUMBR SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:36 
SQLSTATE:(S0022) Native Err:(207) stmt(151448184):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:36 
SQLSTATE:(00000) Native Err:(207) stmt(151448184):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:36 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151410072):*/
{ CALL DYNAMICS.dbo.zDP_SY07220SS_1 ( 0, 305, 1 ) }

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151410072):*/
{ CALL DYNAMICS.dbo.zDP_SY07220SS_1 ( 0, 305, 1 ) }

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151438240):*/
SELECT TOP 25 SECURITYROLEID,SECURITYROLENAME,SECURITYROLEDESC,SECROLETYPE,CRUSRID,CREATDDT,MDFUSRID,MODIFDT,DEX_ROW_ID FROM DYNAMICS.dbo.SY09100 WHERE (SECROLETYPE=1) ORDER BY SECURITYROLEID ASC

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151439144):*/
{ CALL DYNAMICS.dbo.zDP_SY10500SS_1 ( 'shawn', 4, 'POWERUSER' ) }

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151441856):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151440048):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 60, 2 ) }

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151441856):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151440048):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 3830, 22039, 2 ) }

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151440048):*/
{ CALL GAZ.dbo.zDP_POP40100SS_1 ( 1 ) }

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151440952):*/
{ CALL GAZ.dbo.zDP_WF100002SS_3 ( 1, 'Purchase Order Approval' ) }

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151440952):*/
{ CALL GAZ.dbo.zDP_WF100002SS_3 ( 1, 'Purchase Requisition Approval' ) }

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151442760):*/
{ CALL GAZ.dbo.zDP_WF100001SS_1 ( 'Purchase Requisition Approval' ) } 
/*
/* Date: 01/08/2019 Time: 8:04:36 
SQLSTATE:(01000) Native Err:(5701) stmt(0):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Changed database context to 'master'.*/
/*
/* Date: 01/08/2019 Time: 8:04:36 
SQLSTATE:(01000) Native Err:(5703) stmt(0):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Changed language setting to us_english.*/
/*
/* Date: 01/08/2019 Time: 8:04:36 
SQLSTATE:(00000) Native Err:(5703) stmt(0):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:36 
SQLSTATE:(00000) Native Err:(5703) status(0):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151444568):*/
BEGIN SET DATEFORMAT ymd SET NOCOUNT ON SET CURSOR_CLOSE_ON_COMMIT OFF SET ANSI_NULLS ON SET ANSI_WARNINGS OFF SET ANSI_NULL_DFLT_ON ON SET ANSI_PADDING ON SET NUMERIC_ROUNDABORT OFF END

/* Date: 01/08/2019 Time: 8:04:36 
stmt(151441856):*/
select SERVERPROPERTY('ServerName')

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151441856):*/
{ CALL DYNAMICS.dbo.zDP_SY01402SS_1 ( 'GLOBALUSER', 98 ) }

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151440952):*/
{ CALL GAZ.dbo.zDP_WF100002SS_3 ( 1, 'Vendor Approval' ) }

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151440952):*/
{ CALL GAZ.dbo.zDP_WF100002SS_3 ( 1, 'Payables Transaction Approval' ) }

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151440952):*/
{ CALL GAZ.dbo.zDP_WF100002SS_3 ( 1, 'Receivings Transaction Approval' ) }

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151440952):*/
{ CALL GAZ.dbo.zDP_WF100002SS_3 ( 1, 'Purchasing Invoice Approval' ) }

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151510048):*/
{CALL GAZ.dbo.zDP_PM40100F_1(NULL,NULL)}

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151510048):*/
{CALL GAZ.dbo.zDP_PM40100F_1(NULL,NULL)}

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151509144):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 210, 2 ) }

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 210, 2 ) }

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151509144):*/
{ CALL DYNAMICS.dbo.zDP_SY05100SS_1 ( 210 ) }

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151499200):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 252, 2 ) }

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 252, 2 ) }

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151499200):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 829, 2 ) }

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 829, 2 ) }

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151501008):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 734, 2 ) }

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:37 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 734, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151499200):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 888, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 888, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151499200):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 230, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 230, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151501912):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 1350, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 1350, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151499200):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 260, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 260, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151503720):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 775, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 775, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151509144):*/
{ CALL DYNAMICS.dbo.zDP_SY05100SS_1 ( 775 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151499200):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 789, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 789, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151502816):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 254, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 254, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151509144):*/
{ CALL DYNAMICS.dbo.zDP_SY05100SS_1 ( 254 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151501008):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 1092, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 1092, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151499200):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 219, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 219, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151499200):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 266, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 266, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151505528):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 231, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 231, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151509144):*/
{ CALL DYNAMICS.dbo.zDP_SY05100SS_1 ( 231 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151501008):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 895, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 895, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151509144):*/
{ CALL DYNAMICS.dbo.zDP_SY05100SS_1 ( 895 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151506432):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 768, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 768, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151509144):*/
{ CALL DYNAMICS.dbo.zDP_SY05100SS_1 ( 768 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151506432):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 238, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 238, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151499200):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 783, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 783, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151499200):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 880, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 880, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151509144):*/
{ CALL DYNAMICS.dbo.zDP_SY05100SS_1 ( 880 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151500104):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 1517, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 1517, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151509144):*/
{ CALL DYNAMICS.dbo.zDP_SY05100SS_1 ( 1517 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151499200):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 1516, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 1516, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151509144):*/
{ CALL DYNAMICS.dbo.zDP_SY05100SS_1 ( 1516 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151499200):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 1434, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 1434, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151499200):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 202, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 202, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151509144):*/
{ CALL DYNAMICS.dbo.zDP_SY05100SS_1 ( 202 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151501008):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 228, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 228, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151499200):*/
{ CALL GAZ.dbo.zDP_SY02300SS_1 ( 4, 'Purchasing Invoice Entry' ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151499200):*/
{ CALL GAZ.dbo.zDP_SY02300SS_1 ( 4, 'Receivings Trx Entry' ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151499200):*/
{ CALL GAZ.dbo.zDP_SY02300SS_1 ( 4, 'Returns Trx Entry' ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151500104):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 1741, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 1741, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151500104):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 1749, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 1749, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151509144):*/
{ CALL DYNAMICS.dbo.zDP_SY05100SS_1 ( 1749 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151500104):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 1155, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 1155, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151509144):*/
{ CALL DYNAMICS.dbo.zDP_SY05100SS_1 ( 1155 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151500104):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 1740, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 1740, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151509144):*/
{ CALL DYNAMICS.dbo.zDP_SY05100SS_1 ( 1740 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151500104):*/
{CALL GAZ.dbo.zDP_SY04900F_1(NULL,NULL)}

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151501008):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 1741, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 1741, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151501008):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 1741, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 1741, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151505528):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 210, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 210, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151509144):*/
{ CALL DYNAMICS.dbo.zDP_SY05100SS_1 ( 210 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151501008):*/
{ CALL DYNAMICS.dbo.zDP_ACTIVITYSS_1 ( 'Folience', 'shawn', 0 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151497392):*/
{ CALL DYNAMICS.dbo.zDP_SY10000SS_1 ( 'shawn', 4, 0, 210, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151510952):*/
{ CALL DYNAMICS.dbo.zDP_SY10550SS_1 ( 'shawn', 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY10800SS_1 ( 'DEFAULTUSER', 0, 210, 2 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151397296):*/
{ CALL DYNAMICS.dbo.zDP_POA40001SS_1 ( 4 ) }

/* Date: 01/08/2019 Time: 8:04:38 
stmt(151408264):*/
SELECT TOP 25 ListDictID,ListID,ViewID,USERID,ColSequence,ColFieldID,ColArrayIndex,ColFormatFldDictID,ColFormatFldFieldID,ColVisible,ColWidth,ColSortSequence,ColSortOrder,FilterTokenID,DEX_ROW_ID FROM DYNAMICS.dbo.SY07226 WHERE ((ListDictID = 0 AND ListID = 0 AND ViewID = 0 AND USERID = '' AND ColSequence >= 0) OR (ListDictID = 0 AND ListID = 0 AND ViewID = 0 AND USERID > '') OR (ListDictID = 0 AND ListID = 0 AND ViewID > 0) OR (ListDictID = 0 AND ListID > 0) OR (ListDictID > 0)) AND ((ListDictID = 0 AND ListID = 305 AND ViewID = 1 AND USERID = 'shawn' AND ColSequence <= 17) OR (ListDictID = 0 AND ListID = 305 AND ViewID = 1 AND USERID < 'shawn') OR (ListDictID = 0 AND ListID = 305 AND ViewID < 1) OR (ListDictID = 0 AND ListID < 305) OR (ListDictID < 0)) AND ListDictID = 0 AND ListID = 305 AND ViewID = 1 AND USERID = 'shawn' AND ColSequence = 17 ORDER BY ListDictID ASC ,ListID ASC ,ViewID ASC ,USERID ASC ,ColSequence ASC

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151410976):*/
{ CALL DYNAMICS.dbo.zDP_SY07225SS_1 ( 0, 305, 1, '' ) }

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151410976):*/
{ CALL DYNAMICS.dbo.zDP_SY07225SS_1 ( 0, 305, 1, '' ) }

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151402840):*/
SELECT TOP 25 ListDictID,ListID,ViewID,CmdParentDictID,CmdParentFormID,CmdParentCmdID,CmdSequence,CmdDictID,CmdFormID,CmdID,Priority,ButtonSize,CmdCaption,Visible,DEX_ROW_ID FROM DYNAMICS.dbo.SY07240 WHERE ((ListDictID = 0 AND ListID = 305 AND ViewID = 1 AND CmdParentDictID = -10 AND CmdParentFormID = -10 AND CmdParentCmdID = -10 AND CmdSequence >= 0) OR (ListDictID = 0 AND ListID = 305 AND ViewID = 1 AND CmdParentDictID = -10 AND CmdParentFormID = -10 AND CmdParentCmdID > -10) OR (ListDictID = 0 AND ListID = 305 AND ViewID = 1 AND CmdParentDictID = -10 AND CmdParentFormID > -10) OR (ListDictID = 0 AND ListID = 305 AND ViewID = 1 AND CmdParentDictID > -10) OR (ListDictID = 0 AND ListID = 305 AND ViewID > 1) OR (ListDictID = 0 AND ListID > 305) OR (ListDictID > 0)) AND ((ListDictID = 0 AND ListID = 305 AND ViewID = 1 AND CmdParentDictID = 32767 AND CmdParentFormID = 32767 AND CmdParentCmdID = 32767 AND CmdSequence <= 32767) OR (ListDictID = 0 AND ListID = 305 AND ViewID = 1 AND CmdParentDictID = 32767 AND CmdParentFormID = 32767 AND CmdParentCmdID < 32767) OR (ListDictID = 0 AND ListID = 305 AND ViewID = 1 AND CmdParentDictID = 32767 AND CmdParentFormID < 32767) OR (ListDictID = 0 AND ListID = 305 AND ViewID = 1 AND CmdParentDictID < 32767) OR (ListDictID = 0 AND ListID = 305 AND ViewID < 1) OR (ListDictID = 0 AND ListID < 305) OR (ListDictID < 0)) ORDER BY ListDictID ASC ,ListID ASC ,ViewID ASC ,CmdParentDictID ASC ,CmdParentFormID ASC ,CmdParentCmdID ASC ,CmdSequence ASC

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151499200):*/
TRUNCATE TABLE ##0503604

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151402840):*/
SELECT TOP 25 ListDictID,ListID,ViewID,CmdParentDictID,CmdParentFormID,CmdParentCmdID,CmdSequence,CmdDictID,CmdFormID,CmdID,Priority,ButtonSize,CmdCaption,Visible,DEX_ROW_ID FROM DYNAMICS.dbo.SY07240 WHERE ((ListDictID = 0 AND ListID = 305 AND ViewID = 1 AND CmdParentDictID = -10 AND CmdParentFormID = -10 AND CmdParentCmdID = -10 AND CmdSequence >= 0) OR (ListDictID = 0 AND ListID = 305 AND ViewID = 1 AND CmdParentDictID = -10 AND CmdParentFormID = -10 AND CmdParentCmdID > -10) OR (ListDictID = 0 AND ListID = 305 AND ViewID = 1 AND CmdParentDictID = -10 AND CmdParentFormID > -10) OR (ListDictID = 0 AND ListID = 305 AND ViewID = 1 AND CmdParentDictID > -10) OR (ListDictID = 0 AND ListID = 305 AND ViewID > 1) OR (ListDictID = 0 AND ListID > 305) OR (ListDictID > 0)) AND ((ListDictID = 0 AND ListID = 305 AND ViewID = 1 AND CmdParentDictID = 32767 AND CmdParentFormID = 32767 AND CmdParentCmdID = 32767 AND CmdSequence <= 32767) OR (ListDictID = 0 AND ListID = 305 AND ViewID = 1 AND CmdParentDictID = 32767 AND CmdParentFormID = 32767 AND CmdParentCmdID < 32767) OR (ListDictID = 0 AND ListID = 305 AND ViewID = 1 AND CmdParentDictID = 32767 AND CmdParentFormID < 32767) OR (ListDictID = 0 AND ListID = 305 AND ViewID = 1 AND CmdParentDictID < 32767) OR (ListDictID = 0 AND ListID = 305 AND ViewID < 1) OR (ListDictID = 0 AND ListID < 305) OR (ListDictID < 0)) ORDER BY ListDictID DESC ,ListID DESC ,ViewID DESC ,CmdParentDictID DESC ,CmdParentFormID DESC ,CmdParentCmdID DESC ,CmdSequence DESC

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151509144):*/
INSERT INTO ##0503604 (ListDictID, ListID, ViewID, CmdParentDictID, CmdParentFormID, CmdParentCmdID, CmdSequence, CmdDictID, CmdFormID, CmdID, Priority, ButtonSize, CmdCaption, Visible) SELECT ListDictID, ListID, ViewID, CmdParentDictID, CmdParentFormID, CmdParentCmdID, CmdSequence, CmdDictID, CmdFormID, CmdID, Priority, ButtonSize, CmdCaption, Visible FROM DYNAMICS.dbo.SY07240 WHERE ListDictID = 0 AND ListID = 305 AND ViewID = 1 AND CmdParentDictID >= -10 AND CmdParentDictID <= 32767 AND CmdParentFormID >= -10 AND CmdParentFormID <= 32767 AND CmdParentCmdID >= -10 AND CmdParentCmdID <= 32767 AND CmdSequence >= 0 AND CmdSequence <= 32767

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151408264):*/
{ CALL DYNAMICS.dbo.zDP_SY07226SS_1 ( 0, 305, 1, '', 1 ) }

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151510048):*/
TRUNCATE TABLE ##1113604

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151408264):*/
SELECT TOP 25 ListDictID,ListID,ViewID,USERID,ColSequence,ColFieldID,ColArrayIndex,ColFormatFldDictID,ColFormatFldFieldID,ColVisible,ColWidth,ColSortSequence,ColSortOrder,FilterTokenID,DEX_ROW_ID FROM DYNAMICS.dbo.SY07226 WHERE (ListDictID=0 and ListID=305 and ViewID=1 and USERID='') ORDER BY ListDictID DESC ,ListID DESC ,ViewID DESC ,USERID DESC ,ColSequence DESC

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151509144):*/
INSERT INTO ##1113604 (ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID) SELECT ListDictID, ListID, ViewID, USERID, ColSequence, ColFieldID, ColArrayIndex, ColFormatFldDictID, ColFormatFldFieldID, ColVisible, ColWidth, ColSortSequence, ColSortOrder, FilterTokenID FROM DYNAMICS.dbo.SY07226 WHERE ( ListDictID=0 and ListID=305 and ViewID=1 and USERID='' )

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151401032):*/
{ CALL DYNAMICS.dbo.zDP_SY07230SS_1 ( 0, 305, 1 ) }

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151401032):*/
{ CALL DYNAMICS.dbo.zDP_SY07230SS_1 ( 0, 305, 1 ) }

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151401936):*/
SELECT TOP 25 ListDictID,ListID,ViewID,ViewAccessType,IDValue,USERID,IsEditable,DEX_ROW_ID FROM DYNAMICS.dbo.SY07221 WHERE (ListDictID=0 and ListID=305 and ViewID=1) ORDER BY ListDictID ASC ,ListID ASC ,ViewID ASC ,ViewAccessType ASC ,IDValue ASC ,USERID ASC

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151512760):*/
TRUNCATE TABLE ##2513604

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151401936):*/
SELECT TOP 25 ListDictID,ListID,ViewID,ViewAccessType,IDValue,USERID,IsEditable,DEX_ROW_ID FROM DYNAMICS.dbo.SY07221 WHERE (ListDictID=0 and ListID=305 and ViewID=1) ORDER BY ListDictID DESC ,ListID DESC ,ViewID DESC ,ViewAccessType DESC ,IDValue DESC ,USERID DESC

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151505528):*/
INSERT INTO ##2513604 (ListDictID, ListID, ViewID, ViewAccessType, IDValue, USERID, IsEditable) SELECT ListDictID, ListID, ViewID, ViewAccessType, IDValue, USERID, IsEditable FROM DYNAMICS.dbo.SY07221 WHERE ( ListDictID=0 and ListID=305 and ViewID=1 )

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151509144):*/
{ CALL DYNAMICS.dbo.zDP_SY40800SS_1 ( 'Company' ) }

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151506432):*/
{ CALL DYNAMICS.dbo.zDP_SY01402SS_1 ( 'GLOBALUSER', 98 ) }

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151410976):*/
{ CALL DYNAMICS.dbo.zDP_SY07225SS_1 ( 0, 305, 1, 'shawn' ) }

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151410976):*/
{ CALL DYNAMICS.dbo.zDP_SY07225SS_1 ( 0, 305, 1, 'shawn' ) }

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151408264):*/
{ CALL DYNAMICS.dbo.zDP_SY07226SS_1 ( 0, 305, 1, 'shawn', 1 ) }

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151408264):*/
SELECT TOP 25 ListDictID,ListID,ViewID,USERID,ColSequence,ColFieldID,ColArrayIndex,ColFormatFldDictID,ColFormatFldFieldID,ColVisible,ColWidth,ColSortSequence,ColSortOrder,FilterTokenID,DEX_ROW_ID FROM DYNAMICS.dbo.SY07226 WHERE (ListDictID=0 and ListID=305 and ViewID=1 and USERID='shawn') ORDER BY ListDictID ASC ,ListID ASC ,ViewID ASC ,USERID ASC ,ColSequence ASC

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151440048):*/
{ CALL GAZ.dbo.zDP_POP40100SS_1 ( 1 ) }

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151440048):*/
{ CALL GAZ.dbo.zDP_POP40100SS_1 ( 1 ) }

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151509144):*/
{ CALL DYNAMICS.dbo.zDP_SY40800SS_1 ( 'Company' ) }

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151503720):*/
{ CALL DYNAMICS.dbo.zDP_SY01402SS_1 ( 'GLOBALUSER', 98 ) }

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151406456):*/
{CALL ##zDP_0503604F_1(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)}

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151406456):*/
{CALL ##zDP_0503604N_1(25,0,305,1,0,1586,18,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)}

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151449992):*/
{CALL ##zDP_1113604F_1(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)}

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151410976):*/
{ CALL DYNAMICS.dbo.zDP_SY07225SS_1 ( 0, 305, 1, 'shawn' ) }

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151506432):*/
{CALL GAZ.dbo.zDP_SY07250L_1('shawn',0,305,1,'9999.12.31','23:59:59',-2147483648,'shawn',0,305,1,'1900.01.01','00:00:00',2147483647)}

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151411880):*/
{CALL ##zDP_1643604F_1(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)}

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151505528):*/
SELECT COUNT(DOCDATE) FROM ##1643604

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151497392):*/
SELECT COUNT(DOCDATE) FROM ##1643604

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151499200):*/
SELECT COUNT(DOCDATE) FROM ##1643604

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151501008):*/
SELECT COUNT(DOCDATE) FROM ##1643604

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151501912):*/
SELECT COUNT(DOCDATE) FROM ##1643604

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151512760):*/
SELECT COUNT(DOCDATE) FROM ##1643604

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151503720):*/
SELECT COUNT(DOCDATE) FROM ##1643604

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151501912):*/
SELECT COUNT(DOCDATE) FROM ##1643604

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151505528):*/
SELECT COUNT(DOCDATE) FROM ##1643604

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151512760):*/
{ CALL DYNAMICS.dbo.zDP_SY40800SS_1 ( 'Company' ) }

/* Date: 01/08/2019 Time: 8:04:39 
stmt(151502816):*/
{ CALL DYNAMICS.dbo.zDP_SY01402SS_1 ( 'GLOBALUSER', 98 ) }

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151499200):*/
CREATE TABLE ##0304004 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151499200):*/
ALTER TABLE ##0304004 ADD CONSTRAINT PK##0304004 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151499200):*/
CREATE PROC ##zDP_0304004S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0304004 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151499200):*/
CREATE PROC ##zDP_0304004F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0304004 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0304004 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0304004 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151499200):*/
CREATE PROC ##zDP_0304004L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0304004 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0304004 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0304004 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151499200):*/
CREATE PROC ##zDP_0304004N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0304004 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0304004 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0304004 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151499200):*/
CREATE PROC ##zDP_0304004SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##0304004 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151499200):*/
CREATE PROC ##zDP_0304004SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##0304004 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##0304004 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(S0022) Native Err:(207) stmt(151500104):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(00000) Native Err:(207) stmt(151500104):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151497392):*/
{CALL ##zDP_0304004F_1(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)}

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151502816):*/
SELECT COUNT(DOCDATE) FROM ##0304004

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151500104):*/
SELECT COUNT(DOCDATE) FROM ##0304004

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151510048):*/
SELECT COUNT(DOCDATE) FROM ##0304004

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151500104):*/
SELECT COUNT(DOCDATE) FROM ##0304004

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151510048):*/
SELECT COUNT(DOCDATE) FROM ##0304004

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151500104):*/
SELECT COUNT(DOCDATE) FROM ##0304004

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151500104):*/
SELECT COUNT(DOCDATE) FROM ##0304004

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151500104):*/
TRUNCATE TABLE ##1643604

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151509144):*/
{ CALL GAZ.dbo.zDP_POP40200SS_1 ( 'shawn' ) }

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151510048):*/
BEGIN DECLARE @stored_proc_name char(33) DECLARE @retstat int DECLARE @param15 int set nocount on SELECT @stored_proc_name = 'GAZ.dbo.LoadPurchasingTrxListData' EXEC @retstat = @stored_proc_name '##1643604', 24, 1007, '2018.12.10', '2019.01.08', 1, 0, 2, '1=1', '', 'GFC\hodu', 0, 1, 1, @param15 OUT SELECT @retstat, @param15 set nocount on END

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151411880):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##1643604 WHERE ((SOURCE=1 and DCSTATUS=2 ) or SOURCE=5 or SOURCE=19or SOURCE=2) ORDER BY DOCDATE ASC ,DOCTYPE ASC ,SOURCE ASC ,DOCNUMBR ASC ,VENDORID ASC 
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(01000) Native Err:(5701) stmt(0):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Changed database context to 'master'.*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(01000) Native Err:(5703) stmt(0):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Changed language setting to us_english.*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(00000) Native Err:(5703) stmt(0):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(00000) Native Err:(5703) status(0):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151506432):*/
BEGIN SET DATEFORMAT ymd SET NOCOUNT ON SET CURSOR_CLOSE_ON_COMMIT OFF SET ANSI_NULLS ON SET ANSI_WARNINGS OFF SET ANSI_NULL_DFLT_ON ON SET ANSI_PADDING ON SET NUMERIC_ROUNDABORT OFF END

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151510048):*/
use GAZ
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(01000) Native Err:(5701) stmt(151510048):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Changed database context to 'GAZ'.*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(00000) Native Err:(5701) stmt(151510048):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(00000) Native Err:(5701) status(0):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151510048):*/
select top 1 WorkflowInstanceID from WFI10002 where Workflow_Type_Name='Purchase Requisition Approval' and WfBusObjKey='REQ00000000000388'

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151500104):*/
BEGIN DECLARE @stored_proc_name char(26) DECLARE @retstat int DECLARE @param5 char(51) DECLARE @param6 char(37) DECLARE @param7 smallint DECLARE @param8 datetime DECLARE @param9 datetime DECLARE @param10 char(238) DECLARE @param11 char(238) DECLARE @param12 int set nocount on SELECT @param5 = '' SELECT @param6 = '' SELECT @param7 = 0 SELECT @param8 = '2018.12.20' SELECT @param9 = '00:00:00' SELECT @param10 = '' SELECT @param11 = '' SELECT @stored_proc_name = 'GAZ.dbo.wfGetNavListFields' EXEC @retstat = @stored_proc_name '60E55C4E-4C6A-4E29-B27A-D26B6FBF5FC5', 'GFC\hodu', 'Purchase Requisition Approval', 'REQ00000000000388', @param5 OUT, @param6 OUT, @param7 OUT, @param8 OUT, @param9 OUT, @param10 OUT, @param11 OUT, @param12 OUT SELECT @retstat, @param5, @param6, @param7, @param8, @param9, @param10, @param11, @param12 set nocount on END

/* Date: 01/08/2019 Time: 8:04:40*/
BEGIN UPDATE ##1643604 SET Workflow_Name = ?, Workflow_Originator = ?, Workflow_Type_Name = ?, WorkflowInstanceID = ? WHERE Workflow_Name = ? AND Workflow_Originator = ? AND Workflow_Type_Name = ? AND WorkflowInstanceID = ? AND DOCDATE = ? AND VENDORID = ? AND SOURCE = ? AND DOCTYPE = ? AND DOCNUMBR = ? SELECT @@rowcount END

/* Date: 01/08/2019 Time: 8:04:40*/

Prepared stmt(151510048):
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(01000) Native Err:(5701) stmt(0):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Changed database context to 'master'.*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(01000) Native Err:(5703) stmt(0):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Changed language setting to us_english.*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(00000) Native Err:(5703) stmt(0):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(00000) Native Err:(5703) status(0):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151510952):*/
BEGIN SET DATEFORMAT ymd SET NOCOUNT ON SET CURSOR_CLOSE_ON_COMMIT OFF SET ANSI_NULLS ON SET ANSI_WARNINGS OFF SET ANSI_NULL_DFLT_ON ON SET ANSI_PADDING ON SET NUMERIC_ROUNDABORT OFF END

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151500104):*/
use GAZ
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(01000) Native Err:(5701) stmt(151500104):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Changed database context to 'GAZ'.*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(00000) Native Err:(5701) stmt(151500104):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(00000) Native Err:(5701) status(0):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151500104):*/
select top 1 WorkflowInstanceID from WFI10002 where Workflow_Type_Name='Purchase Requisition Approval' and WfBusObjKey='REQ00000000000389'

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151500104):*/
BEGIN DECLARE @stored_proc_name char(26) DECLARE @retstat int DECLARE @param5 char(51) DECLARE @param6 char(37) DECLARE @param7 smallint DECLARE @param8 datetime DECLARE @param9 datetime DECLARE @param10 char(238) DECLARE @param11 char(238) DECLARE @param12 int set nocount on SELECT @param5 = '' SELECT @param6 = '' SELECT @param7 = 0 SELECT @param8 = '2018.12.20' SELECT @param9 = '00:00:00' SELECT @param10 = '' SELECT @param11 = '' SELECT @stored_proc_name = 'GAZ.dbo.wfGetNavListFields' EXEC @retstat = @stored_proc_name 'DAFAD508-CFA9-44B0-B12B-EC39C77CC652', 'GFC\hodu', 'Purchase Requisition Approval', 'REQ00000000000389', @param5 OUT, @param6 OUT, @param7 OUT, @param8 OUT, @param9 OUT, @param10 OUT, @param11 OUT, @param12 OUT SELECT @retstat, @param5, @param6, @param7, @param8, @param9, @param10, @param11, @param12 set nocount on END

/* Date: 01/08/2019 Time: 8:04:40*/

Prepared stmt(151510048):
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(01000) Native Err:(5701) stmt(0):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Changed database context to 'master'.*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(01000) Native Err:(5703) stmt(0):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Changed language setting to us_english.*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(00000) Native Err:(5703) stmt(0):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(00000) Native Err:(5703) status(0):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151500104):*/
BEGIN SET DATEFORMAT ymd SET NOCOUNT ON SET CURSOR_CLOSE_ON_COMMIT OFF SET ANSI_NULLS ON SET ANSI_WARNINGS OFF SET ANSI_NULL_DFLT_ON ON SET ANSI_PADDING ON SET NUMERIC_ROUNDABORT OFF END

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151505528):*/
use GAZ
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(01000) Native Err:(5701) stmt(151505528):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Changed database context to 'GAZ'.*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(00000) Native Err:(5701) stmt(151505528):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(00000) Native Err:(5701) status(0):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151505528):*/
select top 1 WorkflowInstanceID from WFI10002 where Workflow_Type_Name='Purchase Requisition Approval' and WfBusObjKey='REQ00000000000390'

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151503720):*/
BEGIN DECLARE @stored_proc_name char(26) DECLARE @retstat int DECLARE @param5 char(51) DECLARE @param6 char(37) DECLARE @param7 smallint DECLARE @param8 datetime DECLARE @param9 datetime DECLARE @param10 char(238) DECLARE @param11 char(238) DECLARE @param12 int set nocount on SELECT @param5 = '' SELECT @param6 = '' SELECT @param7 = 0 SELECT @param8 = '2018.12.21' SELECT @param9 = '00:00:00' SELECT @param10 = '' SELECT @param11 = '' SELECT @stored_proc_name = 'GAZ.dbo.wfGetNavListFields' EXEC @retstat = @stored_proc_name '3F6E1895-64A8-422D-9D43-5F18E5B72042', 'GFC\hodu', 'Purchase Requisition Approval', 'REQ00000000000390', @param5 OUT, @param6 OUT, @param7 OUT, @param8 OUT, @param9 OUT, @param10 OUT, @param11 OUT, @param12 OUT SELECT @retstat, @param5, @param6, @param7, @param8, @param9, @param10, @param11, @param12 set nocount on END

/* Date: 01/08/2019 Time: 8:04:40*/

Prepared stmt(151510048):

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151500104):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151510952):*/
CREATE TABLE ##2484004 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151510952):*/
ALTER TABLE ##2484004 ADD CONSTRAINT PK##2484004 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151510952):*/
CREATE PROC ##zDP_2484004S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2484004 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151510952):*/
CREATE PROC ##zDP_2484004F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2484004 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2484004 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2484004 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151510952):*/
CREATE PROC ##zDP_2484004L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2484004 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2484004 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2484004 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151510952):*/
CREATE PROC ##zDP_2484004N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2484004 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2484004 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2484004 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151510952):*/
CREATE PROC ##zDP_2484004SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##2484004 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151510952):*/
CREATE PROC ##zDP_2484004SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##2484004 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##2484004 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(S0022) Native Err:(207) stmt(151500104):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(00000) Native Err:(207) stmt(151500104):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151501008):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##2484004 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151500104):*/
SELECT COUNT(DOCNUMBR) FROM ##2484004

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151502816):*/
SELECT COUNT(DOCNUMBR) FROM ##2484004

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151502816):*/
SELECT COUNT(DOCNUMBR) FROM ##2484004

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151505528):*/
SELECT COUNT(DOCNUMBR) FROM ##2484004

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151501912):*/
SELECT COUNT(DOCNUMBR) FROM ##2484004

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151500104):*/
SELECT COUNT(DOCNUMBR) FROM ##2484004

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151500104):*/
SELECT COUNT(DOCNUMBR) FROM ##2484004

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151499200):*/
DROP PROC ##zDP_0304004S_1, ##zDP_0304004N_1, ##zDP_0304004F_1, ##zDP_0304004L_1, ##zDP_0304004SI, ##zDP_0304004SD

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151499200):*/
DROP PROC ##zDP_0304004S_1, ##zDP_0304004N_1, ##zDP_0304004F_1, ##zDP_0304004L_1, ##zDP_0304004SI, ##zDP_0304004SD 
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0304004S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0304004N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0304004F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0304004L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0304004SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0304004SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(00000) Native Err:(3701) stmt(151499200):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:40 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:40 
stmt(151499200):*/
DROP TABLE ##0304004

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151501912):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151503720):*/
CREATE TABLE ##0074104 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151503720):*/
ALTER TABLE ##0074104 ADD CONSTRAINT PK##0074104 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151503720):*/
CREATE PROC ##zDP_0074104S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0074104 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151503720):*/
CREATE PROC ##zDP_0074104F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0074104 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0074104 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0074104 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151503720):*/
CREATE PROC ##zDP_0074104L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0074104 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0074104 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0074104 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151503720):*/
CREATE PROC ##zDP_0074104N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0074104 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0074104 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0074104 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151503720):*/
CREATE PROC ##zDP_0074104SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##0074104 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151503720):*/
CREATE PROC ##zDP_0074104SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##0074104 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##0074104 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0022) Native Err:(207) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(00000) Native Err:(207) stmt(151497392):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151505528):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##0074104 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151506432):*/
SELECT COUNT(DOCNUMBR) FROM ##0074104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151506432):*/
SELECT COUNT(DOCNUMBR) FROM ##0074104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##0074104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151506432):*/
SELECT COUNT(DOCNUMBR) FROM ##0074104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151502816):*/
SELECT COUNT(DOCNUMBR) FROM ##0074104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##0074104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151506432):*/
SELECT COUNT(DOCNUMBR) FROM ##0074104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151510952):*/
DROP PROC ##zDP_2484004S_1, ##zDP_2484004N_1, ##zDP_2484004F_1, ##zDP_2484004L_1, ##zDP_2484004SI, ##zDP_2484004SD

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151510952):*/
DROP PROC ##zDP_2484004S_1, ##zDP_2484004N_1, ##zDP_2484004F_1, ##zDP_2484004L_1, ##zDP_2484004SI, ##zDP_2484004SD 
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2484004S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2484004N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2484004F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2484004L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2484004SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2484004SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(00000) Native Err:(3701) stmt(151510952):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151510952):*/
DROP TABLE ##2484004

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151506432):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151510952):*/
CREATE TABLE ##0424104 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151510952):*/
ALTER TABLE ##0424104 ADD CONSTRAINT PK##0424104 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151510952):*/
CREATE PROC ##zDP_0424104S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0424104 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151510952):*/
CREATE PROC ##zDP_0424104F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0424104 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0424104 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0424104 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151510952):*/
CREATE PROC ##zDP_0424104L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0424104 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0424104 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0424104 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151510952):*/
CREATE PROC ##zDP_0424104N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0424104 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0424104 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0424104 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151510952):*/
CREATE PROC ##zDP_0424104SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##0424104 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151510952):*/
CREATE PROC ##zDP_0424104SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##0424104 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##0424104 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0022) Native Err:(207) stmt(151506432):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(00000) Native Err:(207) stmt(151506432):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151497392):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##0424104 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0424104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0424104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0424104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0424104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0424104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151501008):*/
SELECT COUNT(DOCNUMBR) FROM ##0424104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0424104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151503720):*/
DROP PROC ##zDP_0074104S_1, ##zDP_0074104N_1, ##zDP_0074104F_1, ##zDP_0074104L_1, ##zDP_0074104SI, ##zDP_0074104SD

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151503720):*/
DROP PROC ##zDP_0074104S_1, ##zDP_0074104N_1, ##zDP_0074104F_1, ##zDP_0074104L_1, ##zDP_0074104SI, ##zDP_0074104SD 
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0002) Native Err:(3701) stmt(151503720):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0074104S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0002) Native Err:(3701) stmt(151503720):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0074104N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0002) Native Err:(3701) stmt(151503720):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0074104F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0002) Native Err:(3701) stmt(151503720):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0074104L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0002) Native Err:(3701) stmt(151503720):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0074104SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0002) Native Err:(3701) stmt(151503720):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0074104SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(00000) Native Err:(3701) stmt(151503720):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151503720):*/
DROP TABLE ##0074104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151503720):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151499200):*/
CREATE TABLE ##1094104 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151499200):*/
ALTER TABLE ##1094104 ADD CONSTRAINT PK##1094104 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151499200):*/
CREATE PROC ##zDP_1094104S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1094104 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151499200):*/
CREATE PROC ##zDP_1094104F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1094104 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1094104 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1094104 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151499200):*/
CREATE PROC ##zDP_1094104L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1094104 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1094104 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1094104 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151499200):*/
CREATE PROC ##zDP_1094104N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1094104 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1094104 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1094104 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151499200):*/
CREATE PROC ##zDP_1094104SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##1094104 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151499200):*/
CREATE PROC ##zDP_1094104SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##1094104 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##1094104 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0022) Native Err:(207) stmt(151500104):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(00000) Native Err:(207) stmt(151500104):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151506432):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##1094104 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151503720):*/
SELECT COUNT(DOCNUMBR) FROM ##1094104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151505528):*/
SELECT COUNT(DOCNUMBR) FROM ##1094104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151502816):*/
SELECT COUNT(DOCNUMBR) FROM ##1094104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151500104):*/
SELECT COUNT(DOCNUMBR) FROM ##1094104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151500104):*/
SELECT COUNT(DOCNUMBR) FROM ##1094104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151500104):*/
SELECT COUNT(DOCNUMBR) FROM ##1094104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151500104):*/
SELECT COUNT(DOCNUMBR) FROM ##1094104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151510952):*/
DROP PROC ##zDP_0424104S_1, ##zDP_0424104N_1, ##zDP_0424104F_1, ##zDP_0424104L_1, ##zDP_0424104SI, ##zDP_0424104SD

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151510952):*/
DROP PROC ##zDP_0424104S_1, ##zDP_0424104N_1, ##zDP_0424104F_1, ##zDP_0424104L_1, ##zDP_0424104SI, ##zDP_0424104SD 
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0424104S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0424104N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0424104F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0424104L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0424104SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0424104SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(00000) Native Err:(3701) stmt(151510952):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151510952):*/
DROP TABLE ##0424104

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151510952):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151500104):*/
CREATE TABLE ##1494104 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151500104):*/
ALTER TABLE ##1494104 ADD CONSTRAINT PK##1494104 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151500104):*/
CREATE PROC ##zDP_1494104S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1494104 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151500104):*/
CREATE PROC ##zDP_1494104F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1494104 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1494104 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1494104 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151500104):*/
CREATE PROC ##zDP_1494104L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1494104 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1494104 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1494104 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151500104):*/
CREATE PROC ##zDP_1494104N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1494104 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1494104 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1494104 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151500104):*/
CREATE PROC ##zDP_1494104SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##1494104 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:41 
stmt(151500104):*/
CREATE PROC ##zDP_1494104SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##1494104 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##1494104 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(S0022) Native Err:(207) stmt(151501912):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(00000) Native Err:(207) stmt(151501912):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:41 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151501008):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##1494104 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151510952):*/
SELECT COUNT(DOCNUMBR) FROM ##1494104

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151510952):*/
SELECT COUNT(DOCNUMBR) FROM ##1494104

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151503720):*/
SELECT COUNT(DOCNUMBR) FROM ##1494104

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151510952):*/
SELECT COUNT(DOCNUMBR) FROM ##1494104

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151510952):*/
SELECT COUNT(DOCNUMBR) FROM ##1494104

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151510952):*/
SELECT COUNT(DOCNUMBR) FROM ##1494104

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151505528):*/
SELECT COUNT(DOCNUMBR) FROM ##1494104

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151499200):*/
DROP PROC ##zDP_1094104S_1, ##zDP_1094104N_1, ##zDP_1094104F_1, ##zDP_1094104L_1, ##zDP_1094104SI, ##zDP_1094104SD

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151499200):*/
DROP PROC ##zDP_1094104S_1, ##zDP_1094104N_1, ##zDP_1094104F_1, ##zDP_1094104L_1, ##zDP_1094104SI, ##zDP_1094104SD 
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1094104S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1094104N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1094104F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1094104L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1094104SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1094104SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(00000) Native Err:(3701) stmt(151499200):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151499200):*/
DROP TABLE ##1094104

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151501912):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151510952):*/
CREATE TABLE ##1914204 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151510952):*/
ALTER TABLE ##1914204 ADD CONSTRAINT PK##1914204 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151510952):*/
CREATE PROC ##zDP_1914204S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1914204 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151510952):*/
CREATE PROC ##zDP_1914204F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1914204 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1914204 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1914204 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151510952):*/
CREATE PROC ##zDP_1914204L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1914204 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1914204 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1914204 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151510952):*/
CREATE PROC ##zDP_1914204N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1914204 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1914204 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1914204 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151510952):*/
CREATE PROC ##zDP_1914204SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##1914204 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151510952):*/
CREATE PROC ##zDP_1914204SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##1914204 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##1914204 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0022) Native Err:(207) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(00000) Native Err:(207) stmt(151497392):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151506432):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##1914204 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##1914204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151501912):*/
SELECT COUNT(DOCNUMBR) FROM ##1914204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##1914204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151505528):*/
SELECT COUNT(DOCNUMBR) FROM ##1914204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##1914204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151501912):*/
SELECT COUNT(DOCNUMBR) FROM ##1914204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##1914204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151500104):*/
DROP PROC ##zDP_1494104S_1, ##zDP_1494104N_1, ##zDP_1494104F_1, ##zDP_1494104L_1, ##zDP_1494104SI, ##zDP_1494104SD

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151500104):*/
DROP PROC ##zDP_1494104S_1, ##zDP_1494104N_1, ##zDP_1494104F_1, ##zDP_1494104L_1, ##zDP_1494104SI, ##zDP_1494104SD 
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0002) Native Err:(3701) stmt(151500104):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1494104S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0002) Native Err:(3701) stmt(151500104):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1494104N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0002) Native Err:(3701) stmt(151500104):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1494104F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0002) Native Err:(3701) stmt(151500104):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1494104L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0002) Native Err:(3701) stmt(151500104):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1494104SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0002) Native Err:(3701) stmt(151500104):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1494104SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(00000) Native Err:(3701) stmt(151500104):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151500104):*/
DROP TABLE ##1494104

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151501008):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151501008):*/
CREATE TABLE ##2064204 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151501008):*/
ALTER TABLE ##2064204 ADD CONSTRAINT PK##2064204 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151501008):*/
CREATE PROC ##zDP_2064204S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2064204 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151501008):*/
CREATE PROC ##zDP_2064204F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2064204 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2064204 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2064204 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151501008):*/
CREATE PROC ##zDP_2064204L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2064204 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2064204 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2064204 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151501008):*/
CREATE PROC ##zDP_2064204N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2064204 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2064204 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2064204 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151501008):*/
CREATE PROC ##zDP_2064204SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##2064204 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151501008):*/
CREATE PROC ##zDP_2064204SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##2064204 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##2064204 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0022) Native Err:(207) stmt(151505528):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(00000) Native Err:(207) stmt(151505528):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151497392):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##2064204 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151501912):*/
SELECT COUNT(DOCNUMBR) FROM ##2064204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151503720):*/
SELECT COUNT(DOCNUMBR) FROM ##2064204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##2064204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151500104):*/
SELECT COUNT(DOCNUMBR) FROM ##2064204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151505528):*/
SELECT COUNT(DOCNUMBR) FROM ##2064204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##2064204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151503720):*/
SELECT COUNT(DOCNUMBR) FROM ##2064204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151510952):*/
DROP PROC ##zDP_1914204S_1, ##zDP_1914204N_1, ##zDP_1914204F_1, ##zDP_1914204L_1, ##zDP_1914204SI, ##zDP_1914204SD

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151510952):*/
DROP PROC ##zDP_1914204S_1, ##zDP_1914204N_1, ##zDP_1914204F_1, ##zDP_1914204L_1, ##zDP_1914204SI, ##zDP_1914204SD 
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1914204S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1914204N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1914204F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1914204L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1914204SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1914204SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(00000) Native Err:(3701) stmt(151510952):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151510952):*/
DROP TABLE ##1914204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151505528):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151499200):*/
CREATE TABLE ##0214204 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151499200):*/
ALTER TABLE ##0214204 ADD CONSTRAINT PK##0214204 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151499200):*/
CREATE PROC ##zDP_0214204S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0214204 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151499200):*/
CREATE PROC ##zDP_0214204F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0214204 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0214204 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0214204 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151499200):*/
CREATE PROC ##zDP_0214204L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0214204 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0214204 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0214204 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151499200):*/
CREATE PROC ##zDP_0214204N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0214204 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0214204 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0214204 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151499200):*/
CREATE PROC ##zDP_0214204SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##0214204 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151499200):*/
CREATE PROC ##zDP_0214204SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##0214204 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##0214204 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0022) Native Err:(207) stmt(151502816):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(00000) Native Err:(207) stmt(151502816):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151500104):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##0214204 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151505528):*/
SELECT COUNT(DOCNUMBR) FROM ##0214204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151510952):*/
SELECT COUNT(DOCNUMBR) FROM ##0214204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151505528):*/
SELECT COUNT(DOCNUMBR) FROM ##0214204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151510952):*/
SELECT COUNT(DOCNUMBR) FROM ##0214204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151505528):*/
SELECT COUNT(DOCNUMBR) FROM ##0214204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151510952):*/
SELECT COUNT(DOCNUMBR) FROM ##0214204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151501912):*/
SELECT COUNT(DOCNUMBR) FROM ##0214204

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151501008):*/
DROP PROC ##zDP_2064204S_1, ##zDP_2064204N_1, ##zDP_2064204F_1, ##zDP_2064204L_1, ##zDP_2064204SI, ##zDP_2064204SD

/* Date: 01/08/2019 Time: 8:04:42 
stmt(151501008):*/
DROP PROC ##zDP_2064204S_1, ##zDP_2064204N_1, ##zDP_2064204F_1, ##zDP_2064204L_1, ##zDP_2064204SI, ##zDP_2064204SD 
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0002) Native Err:(3701) stmt(151501008):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2064204S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:42 
SQLSTATE:(S0002) Native Err:(3701) stmt(151501008):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2064204N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151501008):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2064204F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151501008):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2064204L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151501008):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2064204SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151501008):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2064204SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(00000) Native Err:(3701) stmt(151501008):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151501008):*/
DROP TABLE ##2064204

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151506432):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151502816):*/
CREATE TABLE ##0454304 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151502816):*/
ALTER TABLE ##0454304 ADD CONSTRAINT PK##0454304 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151502816):*/
CREATE PROC ##zDP_0454304S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0454304 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151502816):*/
CREATE PROC ##zDP_0454304F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0454304 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0454304 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0454304 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151502816):*/
CREATE PROC ##zDP_0454304L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0454304 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0454304 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0454304 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151502816):*/
CREATE PROC ##zDP_0454304N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0454304 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0454304 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0454304 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151502816):*/
CREATE PROC ##zDP_0454304SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##0454304 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151502816):*/
CREATE PROC ##zDP_0454304SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##0454304 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##0454304 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0022) Native Err:(207) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(00000) Native Err:(207) stmt(151510952):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151501008):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##0454304 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151503720):*/
SELECT COUNT(DOCNUMBR) FROM ##0454304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151510952):*/
SELECT COUNT(DOCNUMBR) FROM ##0454304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151506432):*/
SELECT COUNT(DOCNUMBR) FROM ##0454304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151505528):*/
SELECT COUNT(DOCNUMBR) FROM ##0454304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151505528):*/
SELECT COUNT(DOCNUMBR) FROM ##0454304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151506432):*/
SELECT COUNT(DOCNUMBR) FROM ##0454304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151505528):*/
SELECT COUNT(DOCNUMBR) FROM ##0454304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151499200):*/
DROP PROC ##zDP_0214204S_1, ##zDP_0214204N_1, ##zDP_0214204F_1, ##zDP_0214204L_1, ##zDP_0214204SI, ##zDP_0214204SD

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151499200):*/
DROP PROC ##zDP_0214204S_1, ##zDP_0214204N_1, ##zDP_0214204F_1, ##zDP_0214204L_1, ##zDP_0214204SI, ##zDP_0214204SD 
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0214204S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0214204N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0214204F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0214204L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0214204SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0214204SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(00000) Native Err:(3701) stmt(151499200):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151499200):*/
DROP TABLE ##0214204

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151510952):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151505528):*/
CREATE TABLE ##0234304 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151505528):*/
ALTER TABLE ##0234304 ADD CONSTRAINT PK##0234304 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151505528):*/
CREATE PROC ##zDP_0234304S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0234304 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151505528):*/
CREATE PROC ##zDP_0234304F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0234304 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0234304 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0234304 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151505528):*/
CREATE PROC ##zDP_0234304L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0234304 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0234304 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0234304 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151505528):*/
CREATE PROC ##zDP_0234304N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0234304 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0234304 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0234304 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151505528):*/
CREATE PROC ##zDP_0234304SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##0234304 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151505528):*/
CREATE PROC ##zDP_0234304SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##0234304 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##0234304 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0022) Native Err:(207) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(00000) Native Err:(207) stmt(151497392):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151510952):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##0234304 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151506432):*/
SELECT COUNT(DOCNUMBR) FROM ##0234304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##0234304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151503720):*/
SELECT COUNT(DOCNUMBR) FROM ##0234304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0234304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##0234304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151506432):*/
SELECT COUNT(DOCNUMBR) FROM ##0234304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##0234304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151502816):*/
DROP PROC ##zDP_0454304S_1, ##zDP_0454304N_1, ##zDP_0454304F_1, ##zDP_0454304L_1, ##zDP_0454304SI, ##zDP_0454304SD

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151502816):*/
DROP PROC ##zDP_0454304S_1, ##zDP_0454304N_1, ##zDP_0454304F_1, ##zDP_0454304L_1, ##zDP_0454304SI, ##zDP_0454304SD 
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151502816):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0454304S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151502816):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0454304N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151502816):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0454304F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151502816):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0454304L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151502816):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0454304SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151502816):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0454304SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(00000) Native Err:(3701) stmt(151502816):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151502816):*/
DROP TABLE ##0454304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151497392):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151506432):*/
CREATE TABLE ##0444304 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151506432):*/
ALTER TABLE ##0444304 ADD CONSTRAINT PK##0444304 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151506432):*/
CREATE PROC ##zDP_0444304S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0444304 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151506432):*/
CREATE PROC ##zDP_0444304F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0444304 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0444304 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0444304 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151506432):*/
CREATE PROC ##zDP_0444304L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0444304 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0444304 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0444304 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151506432):*/
CREATE PROC ##zDP_0444304N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0444304 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0444304 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0444304 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151506432):*/
CREATE PROC ##zDP_0444304SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##0444304 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151506432):*/
CREATE PROC ##zDP_0444304SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##0444304 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##0444304 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0022) Native Err:(207) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(00000) Native Err:(207) stmt(151497392):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151499200):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##0444304 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##0444304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151500104):*/
SELECT COUNT(DOCNUMBR) FROM ##0444304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151501008):*/
SELECT COUNT(DOCNUMBR) FROM ##0444304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151502816):*/
SELECT COUNT(DOCNUMBR) FROM ##0444304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##0444304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##0444304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##0444304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151505528):*/
DROP PROC ##zDP_0234304S_1, ##zDP_0234304N_1, ##zDP_0234304F_1, ##zDP_0234304L_1, ##zDP_0234304SI, ##zDP_0234304SD

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151505528):*/
DROP PROC ##zDP_0234304S_1, ##zDP_0234304N_1, ##zDP_0234304F_1, ##zDP_0234304L_1, ##zDP_0234304SI, ##zDP_0234304SD 
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151505528):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0234304S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151505528):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0234304N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151505528):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0234304F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151505528):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0234304L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151505528):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0234304SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0002) Native Err:(3701) stmt(151505528):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0234304SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(00000) Native Err:(3701) stmt(151505528):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151505528):*/
DROP TABLE ##0234304

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151500104):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151497392):*/
CREATE TABLE ##0684304 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151497392):*/
ALTER TABLE ##0684304 ADD CONSTRAINT PK##0684304 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151497392):*/
CREATE PROC ##zDP_0684304S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0684304 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151497392):*/
CREATE PROC ##zDP_0684304F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0684304 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0684304 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0684304 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151497392):*/
CREATE PROC ##zDP_0684304L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0684304 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0684304 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0684304 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151497392):*/
CREATE PROC ##zDP_0684304N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0684304 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0684304 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0684304 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151497392):*/
CREATE PROC ##zDP_0684304SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##0684304 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151497392):*/
CREATE PROC ##zDP_0684304SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##0684304 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##0684304 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(S0022) Native Err:(207) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(00000) Native Err:(207) stmt(151510952):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:43 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151500104):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##0684304 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:43 
stmt(151501008):*/
SELECT COUNT(DOCNUMBR) FROM ##0684304

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151510952):*/
SELECT COUNT(DOCNUMBR) FROM ##0684304

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151510952):*/
SELECT COUNT(DOCNUMBR) FROM ##0684304

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151510952):*/
SELECT COUNT(DOCNUMBR) FROM ##0684304

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151501008):*/
SELECT COUNT(DOCNUMBR) FROM ##0684304

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151501008):*/
SELECT COUNT(DOCNUMBR) FROM ##0684304

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151501008):*/
SELECT COUNT(DOCNUMBR) FROM ##0684304

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151506432):*/
DROP PROC ##zDP_0444304S_1, ##zDP_0444304N_1, ##zDP_0444304F_1, ##zDP_0444304L_1, ##zDP_0444304SI, ##zDP_0444304SD

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151506432):*/
DROP PROC ##zDP_0444304S_1, ##zDP_0444304N_1, ##zDP_0444304F_1, ##zDP_0444304L_1, ##zDP_0444304SI, ##zDP_0444304SD 
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151506432):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0444304S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151506432):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0444304N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151506432):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0444304F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151506432):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0444304L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151506432):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0444304SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151506432):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0444304SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(00000) Native Err:(3701) stmt(151506432):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151506432):*/
DROP TABLE ##0444304

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151499200):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151499200):*/
CREATE TABLE ##0894404 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151499200):*/
ALTER TABLE ##0894404 ADD CONSTRAINT PK##0894404 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151499200):*/
CREATE PROC ##zDP_0894404S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0894404 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151499200):*/
CREATE PROC ##zDP_0894404F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0894404 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0894404 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0894404 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151499200):*/
CREATE PROC ##zDP_0894404L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0894404 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0894404 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0894404 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151499200):*/
CREATE PROC ##zDP_0894404N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0894404 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0894404 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0894404 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151499200):*/
CREATE PROC ##zDP_0894404SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##0894404 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151499200):*/
CREATE PROC ##zDP_0894404SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##0894404 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##0894404 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0022) Native Err:(207) stmt(151501008):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(00000) Native Err:(207) stmt(151501008):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151501912):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##0894404 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151501008):*/
SELECT COUNT(DOCNUMBR) FROM ##0894404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151505528):*/
SELECT COUNT(DOCNUMBR) FROM ##0894404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151505528):*/
SELECT COUNT(DOCNUMBR) FROM ##0894404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151501008):*/
SELECT COUNT(DOCNUMBR) FROM ##0894404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151501008):*/
SELECT COUNT(DOCNUMBR) FROM ##0894404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151501008):*/
SELECT COUNT(DOCNUMBR) FROM ##0894404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151501008):*/
SELECT COUNT(DOCNUMBR) FROM ##0894404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151497392):*/
DROP PROC ##zDP_0684304S_1, ##zDP_0684304N_1, ##zDP_0684304F_1, ##zDP_0684304L_1, ##zDP_0684304SI, ##zDP_0684304SD

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151497392):*/
DROP PROC ##zDP_0684304S_1, ##zDP_0684304N_1, ##zDP_0684304F_1, ##zDP_0684304L_1, ##zDP_0684304SI, ##zDP_0684304SD 
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0684304S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0684304N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0684304F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0684304L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0684304SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0684304SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(00000) Native Err:(3701) stmt(151497392):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151497392):*/
DROP TABLE ##0684304

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151505528):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151500104):*/
CREATE TABLE ##1554404 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151500104):*/
ALTER TABLE ##1554404 ADD CONSTRAINT PK##1554404 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151500104):*/
CREATE PROC ##zDP_1554404S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1554404 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151500104):*/
CREATE PROC ##zDP_1554404F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1554404 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1554404 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1554404 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151500104):*/
CREATE PROC ##zDP_1554404L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1554404 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1554404 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1554404 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151500104):*/
CREATE PROC ##zDP_1554404N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1554404 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1554404 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##1554404 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151500104):*/
CREATE PROC ##zDP_1554404SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##1554404 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151500104):*/
CREATE PROC ##zDP_1554404SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##1554404 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##1554404 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0022) Native Err:(207) stmt(151502816):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(00000) Native Err:(207) stmt(151502816):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151501008):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##1554404 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151502816):*/
SELECT COUNT(DOCNUMBR) FROM ##1554404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##1554404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151510952):*/
SELECT COUNT(DOCNUMBR) FROM ##1554404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151502816):*/
SELECT COUNT(DOCNUMBR) FROM ##1554404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151510952):*/
SELECT COUNT(DOCNUMBR) FROM ##1554404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151505528):*/
SELECT COUNT(DOCNUMBR) FROM ##1554404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151505528):*/
SELECT COUNT(DOCNUMBR) FROM ##1554404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151499200):*/
DROP PROC ##zDP_0894404S_1, ##zDP_0894404N_1, ##zDP_0894404F_1, ##zDP_0894404L_1, ##zDP_0894404SI, ##zDP_0894404SD

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151499200):*/
DROP PROC ##zDP_0894404S_1, ##zDP_0894404N_1, ##zDP_0894404F_1, ##zDP_0894404L_1, ##zDP_0894404SI, ##zDP_0894404SD 
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0894404S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0894404N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0894404F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0894404L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0894404SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0894404SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(00000) Native Err:(3701) stmt(151499200):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151499200):*/
DROP TABLE ##0894404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151510952):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151510952):*/
CREATE TABLE ##2454404 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151510952):*/
ALTER TABLE ##2454404 ADD CONSTRAINT PK##2454404 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151510952):*/
CREATE PROC ##zDP_2454404S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2454404 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151510952):*/
CREATE PROC ##zDP_2454404F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2454404 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2454404 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2454404 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151510952):*/
CREATE PROC ##zDP_2454404L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2454404 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2454404 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2454404 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151510952):*/
CREATE PROC ##zDP_2454404N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2454404 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2454404 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2454404 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151510952):*/
CREATE PROC ##zDP_2454404SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##2454404 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151510952):*/
CREATE PROC ##zDP_2454404SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##2454404 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##2454404 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0022) Native Err:(207) stmt(151503720):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(00000) Native Err:(207) stmt(151503720):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151501912):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##2454404 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151502816):*/
SELECT COUNT(DOCNUMBR) FROM ##2454404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##2454404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##2454404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151502816):*/
SELECT COUNT(DOCNUMBR) FROM ##2454404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151502816):*/
SELECT COUNT(DOCNUMBR) FROM ##2454404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##2454404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##2454404

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151500104):*/
DROP PROC ##zDP_1554404S_1, ##zDP_1554404N_1, ##zDP_1554404F_1, ##zDP_1554404L_1, ##zDP_1554404SI, ##zDP_1554404SD

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151500104):*/
DROP PROC ##zDP_1554404S_1, ##zDP_1554404N_1, ##zDP_1554404F_1, ##zDP_1554404L_1, ##zDP_1554404SI, ##zDP_1554404SD 
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151500104):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1554404S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151500104):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1554404N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151500104):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1554404F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151500104):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1554404L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151500104):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1554404SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(S0002) Native Err:(3701) stmt(151500104):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_1554404SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(00000) Native Err:(3701) stmt(151500104):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:44 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:44 
stmt(151500104):*/
DROP TABLE ##1554404

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151497392):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151497392):*/
CREATE TABLE ##0314504 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151497392):*/
ALTER TABLE ##0314504 ADD CONSTRAINT PK##0314504 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151497392):*/
CREATE PROC ##zDP_0314504S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0314504 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151497392):*/
CREATE PROC ##zDP_0314504F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0314504 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0314504 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0314504 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151497392):*/
CREATE PROC ##zDP_0314504L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0314504 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0314504 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0314504 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151497392):*/
CREATE PROC ##zDP_0314504N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0314504 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0314504 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0314504 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151497392):*/
CREATE PROC ##zDP_0314504SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##0314504 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151497392):*/
CREATE PROC ##zDP_0314504SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##0314504 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##0314504 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0022) Native Err:(207) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(00000) Native Err:(207) stmt(151499200):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151500104):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##0314504 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0314504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0314504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0314504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0314504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0314504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0314504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0314504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151510952):*/
DROP PROC ##zDP_2454404S_1, ##zDP_2454404N_1, ##zDP_2454404F_1, ##zDP_2454404L_1, ##zDP_2454404SI, ##zDP_2454404SD

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151510952):*/
DROP PROC ##zDP_2454404S_1, ##zDP_2454404N_1, ##zDP_2454404F_1, ##zDP_2454404L_1, ##zDP_2454404SI, ##zDP_2454404SD 
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2454404S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2454404N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2454404F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2454404L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2454404SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2454404SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(00000) Native Err:(3701) stmt(151510952):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151510952):*/
DROP TABLE ##2454404

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151505528):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151510952):*/
CREATE TABLE ##0124504 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151510952):*/
ALTER TABLE ##0124504 ADD CONSTRAINT PK##0124504 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151510952):*/
CREATE PROC ##zDP_0124504S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0124504 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151510952):*/
CREATE PROC ##zDP_0124504F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0124504 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0124504 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0124504 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151510952):*/
CREATE PROC ##zDP_0124504L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0124504 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0124504 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0124504 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151510952):*/
CREATE PROC ##zDP_0124504N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0124504 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0124504 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0124504 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151510952):*/
CREATE PROC ##zDP_0124504SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##0124504 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151510952):*/
CREATE PROC ##zDP_0124504SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##0124504 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##0124504 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0022) Native Err:(207) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(00000) Native Err:(207) stmt(151499200):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151501008):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##0124504 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0124504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151501912):*/
SELECT COUNT(DOCNUMBR) FROM ##0124504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0124504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151501912):*/
SELECT COUNT(DOCNUMBR) FROM ##0124504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0124504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151502816):*/
SELECT COUNT(DOCNUMBR) FROM ##0124504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151505528):*/
SELECT COUNT(DOCNUMBR) FROM ##0124504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151497392):*/
DROP PROC ##zDP_0314504S_1, ##zDP_0314504N_1, ##zDP_0314504F_1, ##zDP_0314504L_1, ##zDP_0314504SI, ##zDP_0314504SD

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151497392):*/
DROP PROC ##zDP_0314504S_1, ##zDP_0314504N_1, ##zDP_0314504F_1, ##zDP_0314504L_1, ##zDP_0314504SI, ##zDP_0314504SD 
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0314504S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0314504N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0314504F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0314504L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0314504SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0314504SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(00000) Native Err:(3701) stmt(151497392):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151497392):*/
DROP TABLE ##0314504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151501912):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151499200):*/
CREATE TABLE ##0004504 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151499200):*/
ALTER TABLE ##0004504 ADD CONSTRAINT PK##0004504 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151499200):*/
CREATE PROC ##zDP_0004504S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0004504 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151499200):*/
CREATE PROC ##zDP_0004504F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0004504 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0004504 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0004504 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151499200):*/
CREATE PROC ##zDP_0004504L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0004504 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0004504 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0004504 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151499200):*/
CREATE PROC ##zDP_0004504N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0004504 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0004504 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0004504 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151499200):*/
CREATE PROC ##zDP_0004504SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##0004504 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151499200):*/
CREATE PROC ##zDP_0004504SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##0004504 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##0004504 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0022) Native Err:(207) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(00000) Native Err:(207) stmt(151497392):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151500104):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##0004504 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##0004504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##0004504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##0004504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151502816):*/
SELECT COUNT(DOCNUMBR) FROM ##0004504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151502816):*/
SELECT COUNT(DOCNUMBR) FROM ##0004504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151501912):*/
SELECT COUNT(DOCNUMBR) FROM ##0004504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151505528):*/
SELECT COUNT(DOCNUMBR) FROM ##0004504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151510952):*/
DROP PROC ##zDP_0124504S_1, ##zDP_0124504N_1, ##zDP_0124504F_1, ##zDP_0124504L_1, ##zDP_0124504SI, ##zDP_0124504SD

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151510952):*/
DROP PROC ##zDP_0124504S_1, ##zDP_0124504N_1, ##zDP_0124504F_1, ##zDP_0124504L_1, ##zDP_0124504SI, ##zDP_0124504SD 
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0124504S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0124504N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0124504F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0124504L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0124504SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0124504SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(00000) Native Err:(3701) stmt(151510952):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151510952):*/
DROP TABLE ##0124504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151501008):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151506432):*/
CREATE TABLE ##2364504 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151506432):*/
ALTER TABLE ##2364504 ADD CONSTRAINT PK##2364504 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151506432):*/
CREATE PROC ##zDP_2364504S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2364504 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151506432):*/
CREATE PROC ##zDP_2364504F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2364504 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2364504 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2364504 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151506432):*/
CREATE PROC ##zDP_2364504L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2364504 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2364504 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2364504 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151506432):*/
CREATE PROC ##zDP_2364504N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2364504 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2364504 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2364504 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151506432):*/
CREATE PROC ##zDP_2364504SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##2364504 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151506432):*/
CREATE PROC ##zDP_2364504SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##2364504 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##2364504 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0022) Native Err:(207) stmt(151501008):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(00000) Native Err:(207) stmt(151501008):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151505528):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##2364504 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##2364504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151503720):*/
SELECT COUNT(DOCNUMBR) FROM ##2364504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##2364504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151510952):*/
SELECT COUNT(DOCNUMBR) FROM ##2364504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151501912):*/
SELECT COUNT(DOCNUMBR) FROM ##2364504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151510952):*/
SELECT COUNT(DOCNUMBR) FROM ##2364504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151510952):*/
SELECT COUNT(DOCNUMBR) FROM ##2364504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151499200):*/
DROP PROC ##zDP_0004504S_1, ##zDP_0004504N_1, ##zDP_0004504F_1, ##zDP_0004504L_1, ##zDP_0004504SI, ##zDP_0004504SD

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151499200):*/
DROP PROC ##zDP_0004504S_1, ##zDP_0004504N_1, ##zDP_0004504F_1, ##zDP_0004504L_1, ##zDP_0004504SI, ##zDP_0004504SD 
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0004504S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0004504N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0004504F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0004504L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0004504SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0004504SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(00000) Native Err:(3701) stmt(151499200):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:45 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151499200):*/
DROP TABLE ##0004504

/* Date: 01/08/2019 Time: 8:04:45 
stmt(151510952):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151499200):*/
CREATE TABLE ##2224504 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151499200):*/
ALTER TABLE ##2224504 ADD CONSTRAINT PK##2224504 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151499200):*/
CREATE PROC ##zDP_2224504S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2224504 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151499200):*/
CREATE PROC ##zDP_2224504F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2224504 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2224504 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2224504 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151499200):*/
CREATE PROC ##zDP_2224504L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2224504 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2224504 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2224504 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151499200):*/
CREATE PROC ##zDP_2224504N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2224504 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2224504 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2224504 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151499200):*/
CREATE PROC ##zDP_2224504SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##2224504 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151499200):*/
CREATE PROC ##zDP_2224504SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##2224504 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##2224504 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0022) Native Err:(207) stmt(151501912):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(00000) Native Err:(207) stmt(151501912):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151510952):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##2224504 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##2224504

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##2224504

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##2224504

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##2224504

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151501008):*/
SELECT COUNT(DOCNUMBR) FROM ##2224504

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##2224504

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
SELECT COUNT(DOCNUMBR) FROM ##2224504

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151506432):*/
DROP PROC ##zDP_2364504S_1, ##zDP_2364504N_1, ##zDP_2364504F_1, ##zDP_2364504L_1, ##zDP_2364504SI, ##zDP_2364504SD

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151506432):*/
DROP PROC ##zDP_2364504S_1, ##zDP_2364504N_1, ##zDP_2364504F_1, ##zDP_2364504L_1, ##zDP_2364504SI, ##zDP_2364504SD 
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151506432):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2364504S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151506432):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2364504N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151506432):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2364504F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151506432):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2364504L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151506432):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2364504SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151506432):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2364504SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(00000) Native Err:(3701) stmt(151506432):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151506432):*/
DROP TABLE ##2364504

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151501912):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
CREATE TABLE ##0184604 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
ALTER TABLE ##0184604 ADD CONSTRAINT PK##0184604 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
CREATE PROC ##zDP_0184604S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0184604 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
CREATE PROC ##zDP_0184604F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0184604 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0184604 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0184604 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
CREATE PROC ##zDP_0184604L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0184604 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0184604 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0184604 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
CREATE PROC ##zDP_0184604N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0184604 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0184604 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0184604 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
CREATE PROC ##zDP_0184604SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##0184604 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
CREATE PROC ##zDP_0184604SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##0184604 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##0184604 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0022) Native Err:(207) stmt(151500104):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(00000) Native Err:(207) stmt(151500104):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151505528):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##0184604 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151500104):*/
SELECT COUNT(DOCNUMBR) FROM ##0184604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151506432):*/
SELECT COUNT(DOCNUMBR) FROM ##0184604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151500104):*/
SELECT COUNT(DOCNUMBR) FROM ##0184604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151503720):*/
SELECT COUNT(DOCNUMBR) FROM ##0184604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151500104):*/
SELECT COUNT(DOCNUMBR) FROM ##0184604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151502816):*/
SELECT COUNT(DOCNUMBR) FROM ##0184604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151500104):*/
SELECT COUNT(DOCNUMBR) FROM ##0184604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151499200):*/
DROP PROC ##zDP_2224504S_1, ##zDP_2224504N_1, ##zDP_2224504F_1, ##zDP_2224504L_1, ##zDP_2224504SI, ##zDP_2224504SD

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151499200):*/
DROP PROC ##zDP_2224504S_1, ##zDP_2224504N_1, ##zDP_2224504F_1, ##zDP_2224504L_1, ##zDP_2224504SI, ##zDP_2224504SD 
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2224504S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2224504N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2224504F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2224504L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2224504SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2224504SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(00000) Native Err:(3701) stmt(151499200):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151499200):*/
DROP TABLE ##2224504

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151510952):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151510952):*/
CREATE TABLE ##2554604 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151510952):*/
ALTER TABLE ##2554604 ADD CONSTRAINT PK##2554604 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151510952):*/
CREATE PROC ##zDP_2554604S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2554604 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151510952):*/
CREATE PROC ##zDP_2554604F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2554604 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2554604 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2554604 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151510952):*/
CREATE PROC ##zDP_2554604L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2554604 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2554604 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2554604 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151510952):*/
CREATE PROC ##zDP_2554604N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2554604 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2554604 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##2554604 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151510952):*/
CREATE PROC ##zDP_2554604SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##2554604 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151510952):*/
CREATE PROC ##zDP_2554604SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##2554604 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##2554604 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0022) Native Err:(207) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(00000) Native Err:(207) stmt(151499200):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151500104):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##2554604 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151506432):*/
SELECT COUNT(DOCNUMBR) FROM ##2554604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##2554604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151501008):*/
SELECT COUNT(DOCNUMBR) FROM ##2554604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##2554604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##2554604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##2554604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151502816):*/
SELECT COUNT(DOCNUMBR) FROM ##2554604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
DROP PROC ##zDP_0184604S_1, ##zDP_0184604N_1, ##zDP_0184604F_1, ##zDP_0184604L_1, ##zDP_0184604SI, ##zDP_0184604SD

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
DROP PROC ##zDP_0184604S_1, ##zDP_0184604N_1, ##zDP_0184604F_1, ##zDP_0184604L_1, ##zDP_0184604SI, ##zDP_0184604SD 
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0184604S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0184604N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0184604F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0184604L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0184604SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0184604SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(00000) Native Err:(3701) stmt(151497392):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
DROP TABLE ##0184604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151501008):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
CREATE TABLE ##0184604 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
ALTER TABLE ##0184604 ADD CONSTRAINT PK##0184604 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
CREATE PROC ##zDP_0184604S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0184604 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
CREATE PROC ##zDP_0184604F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0184604 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0184604 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0184604 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
CREATE PROC ##zDP_0184604L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0184604 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0184604 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0184604 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
CREATE PROC ##zDP_0184604N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0184604 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0184604 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0184604 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
CREATE PROC ##zDP_0184604SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##0184604 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151497392):*/
CREATE PROC ##zDP_0184604SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##0184604 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##0184604 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0022) Native Err:(207) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(00000) Native Err:(207) stmt(151499200):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151501008):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##0184604 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0184604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0184604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151501912):*/
SELECT COUNT(DOCNUMBR) FROM ##0184604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151501912):*/
SELECT COUNT(DOCNUMBR) FROM ##0184604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0184604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0184604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0184604

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151510952):*/
DROP PROC ##zDP_2554604S_1, ##zDP_2554604N_1, ##zDP_2554604F_1, ##zDP_2554604L_1, ##zDP_2554604SI, ##zDP_2554604SD

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151510952):*/
DROP PROC ##zDP_2554604S_1, ##zDP_2554604N_1, ##zDP_2554604F_1, ##zDP_2554604L_1, ##zDP_2554604SI, ##zDP_2554604SD 
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2554604S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2554604N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2554604F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2554604L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2554604SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(S0002) Native Err:(3701) stmt(151510952):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_2554604SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(00000) Native Err:(3701) stmt(151510952):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:46 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:46 
stmt(151510952):*/
DROP TABLE ##2554604

/* Date: 01/08/2019 Time: 8:04:47 
stmt(151503720):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

/* Date: 01/08/2019 Time: 8:04:47 
stmt(151500104):*/
CREATE TABLE ##0254704 (DOCDATE datetime NOT NULL CHECK (DATEPART(hour,DOCDATE) = 0 and DATEPART(minute,DOCDATE) = 0 and DATEPART(second,DOCDATE) = 0 and DATEPART(millisecond,DOCDATE) = 0), VENDORID char(15) NOT NULL, VENDNAME char(65) NOT NULL, CONTACT char(61) NOT NULL, SOURCE smallint NOT NULL, DOCTYPE smallint NOT NULL, DOCTYNAM char(21) NOT NULL, DOCNUMBR char(21) NOT NULL, Other_Number char(21) NOT NULL, TRXSORCE char(13) NOT NULL, CNTRLTYP smallint NOT NULL, DCSTATUS smallint NOT NULL, POSTATUS smallint NOT NULL, STSDESCR char(31) NOT NULL, DOCAMNT numeric(19,5) NOT NULL, CURNCYID char(15) NOT NULL, CURRNIDX smallint NOT NULL, PRSTADCD char(15) NOT NULL, VOIDED tinyint NOT NULL, PRMDATE datetime NOT NULL CHECK (DATEPART(hour,PRMDATE) = 0 and DATEPART(minute,PRMDATE) = 0 and DATEPART(second,PRMDATE) = 0 and DATEPART(millisecond,PRMDATE) = 0), REQDATE datetime NOT NULL CHECK (DATEPART(hour,REQDATE) = 0 and DATEPART(minute,REQDATE) = 0 and DATEPART(second,REQDATE) = 0 and DATEPART(millisecond,REQDATE) = 0), Workflow_Due_Date datetime NOT NULL CHECK (DATEPART(hour,Workflow_Due_Date) = 0 and DATEPART(minute,Workflow_Due_Date) = 0 and DATEPART(second,Workflow_Due_Date) = 0 and DATEPART(millisecond,Workflow_Due_Date) = 0), Workflow_Due_Time datetime NOT NULL CHECK (DATEPART(day,Workflow_Due_Time) = 1 and DATEPART(month,Workflow_Due_Time) = 1 and DATEPART(year,Workflow_Due_Time) = 1900 ), Workflow_Approval_Status smallint NOT NULL, Workflow_Status smallint NOT NULL, Workflow_Name char(51) NOT NULL, Workflow_Approver char(238) NOT NULL, Workflow_Priority smallint NOT NULL, Workflow_Originator char(238) NOT NULL, Workflow_Type_Name char(51) NOT NULL, WorkflowInstanceID char(37) NOT NULL, WorkflowStepInstanceID char(37) NOT NULL, Workflow_Step_Type smallint NOT NULL, MKTOPROC tinyint NOT NULL, InfoValue smallint NOT NULL, HOLD tinyint NOT NULL, DUEDATE datetime NOT NULL CHECK (DATEPART(hour,DUEDATE) = 0 and DATEPART(minute,DUEDATE) = 0 and DATEPART(second,DUEDATE) = 0 and DATEPART(millisecond,DUEDATE) = 0), DISCDATE datetime NOT NULL CHECK (DATEPART(hour,DISCDATE) = 0 and DATEPART(minute,DISCDATE) = 0 and DATEPART(second,DISCDATE) = 0 and DATEPART(millisecond,DISCDATE) = 0), WF_Step_Type smallint NOT NULL, BCHSOURC char(15) NOT NULL, REQSTDBY char(21) NOT NULL, RequisitionDescription char(61) NOT NULL, RequisitionStatus smallint NOT NULL, COMMNTID char(15) NOT NULL, USERDEF1 char(21) NOT NULL, USERDEF2 char(21) NOT NULL, DEX_ROW_ID int identity NOT NULL)

/* Date: 01/08/2019 Time: 8:04:47 
stmt(151500104):*/
ALTER TABLE ##0254704 ADD CONSTRAINT PK##0254704 PRIMARY KEY NONCLUSTERED (DOCDATE, DOCTYPE, SOURCE, DOCNUMBR, VENDORID)

/* Date: 01/08/2019 Time: 8:04:47 
stmt(151500104):*/
CREATE PROC ##zDP_0254704S_1 (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15)) AS /* 18.00.0010.000 */ set nocount on SELECT TOP 1 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0254704 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC set nocount off

/* Date: 01/08/2019 Time: 8:04:47 
stmt(151500104):*/
CREATE PROC ##zDP_0254704F_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0254704 ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0254704 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0254704 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:47 
stmt(151500104):*/
CREATE PROC ##zDP_0254704L_1 (@DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0254704 ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0254704 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0254704 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE ORDER BY DOCDATE DESC, DOCTYPE DESC, SOURCE DESC, DOCNUMBR DESC, VENDORID DESC END set nocount off

/* Date: 01/08/2019 Time: 8:04:47 
stmt(151500104):*/
CREATE PROC ##zDP_0254704N_1 (@BS int, @DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @DOCDATE_RS datetime, @DOCTYPE_RS smallint, @SOURCE_RS smallint, @DOCNUMBR_RS char(21), @VENDORID_RS char(15), @DOCDATE_RE datetime, @DOCTYPE_RE smallint, @SOURCE_RE smallint, @DOCNUMBR_RE char(21), @VENDORID_RE char(15)) AS /* 18.00.0010.000 */ set nocount on IF @DOCDATE_RS IS NULL BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0254704 WHERE ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE IF @DOCDATE_RS = @DOCDATE_RE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0254704 WHERE DOCDATE = @DOCDATE_RS AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END ELSE BEGIN SELECT TOP 25 DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2, DEX_ROW_ID FROM .##0254704 WHERE DOCDATE BETWEEN @DOCDATE_RS AND @DOCDATE_RE AND DOCTYPE BETWEEN @DOCTYPE_RS AND @DOCTYPE_RE AND SOURCE BETWEEN @SOURCE_RS AND @SOURCE_RE AND DOCNUMBR BETWEEN @DOCNUMBR_RS AND @DOCNUMBR_RE AND VENDORID BETWEEN @VENDORID_RS AND @VENDORID_RE AND ( DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID > @VENDORID OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR > @DOCNUMBR OR DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE > @SOURCE OR DOCDATE = @DOCDATE AND DOCTYPE > @DOCTYPE OR DOCDATE > @DOCDATE ) ORDER BY DOCDATE ASC, DOCTYPE ASC, SOURCE ASC, DOCNUMBR ASC, VENDORID ASC END set nocount off

/* Date: 01/08/2019 Time: 8:04:47 
stmt(151500104):*/
CREATE PROC ##zDP_0254704SI (@DOCDATE datetime, @VENDORID char(15), @VENDNAME char(65), @CONTACT char(61), @SOURCE smallint, @DOCTYPE smallint, @DOCTYNAM char(21), @DOCNUMBR char(21), @Other_Number char(21), @TRXSORCE char(13), @CNTRLTYP smallint, @DCSTATUS smallint, @POSTATUS smallint, @STSDESCR char(31), @DOCAMNT numeric(19,5), @CURNCYID char(15), @CURRNIDX smallint, @PRSTADCD char(15), @VOIDED tinyint, @PRMDATE datetime, @REQDATE datetime, @Workflow_Due_Date datetime, @Workflow_Due_Time datetime, @Workflow_Approval_Status smallint, @Workflow_Status smallint, @Workflow_Name char(51), @Workflow_Approver char(238), @Workflow_Priority smallint, @Workflow_Originator char(238), @Workflow_Type_Name char(51), @WorkflowInstanceID char(37), @WorkflowStepInstanceID char(37), @Workflow_Step_Type smallint, @MKTOPROC tinyint, @InfoValue smallint, @HOLD tinyint, @DUEDATE datetime, @DISCDATE datetime, @WF_Step_Type smallint, @BCHSOURC char(15), @REQSTDBY char(21), @RequisitionDescription char(61), @RequisitionStatus smallint, @COMMNTID char(15), @USERDEF1 char(21), @USERDEF2 char(21), @DEX_ROW_ID int OUT) AS /* 18.00.0010.000 */ set nocount on BEGIN INSERT INTO .##0254704 (DOCDATE, VENDORID, VENDNAME, CONTACT, SOURCE, DOCTYPE, DOCTYNAM, DOCNUMBR, Other_Number, TRXSORCE, CNTRLTYP, DCSTATUS, POSTATUS, STSDESCR, DOCAMNT, CURNCYID, CURRNIDX, PRSTADCD, VOIDED, PRMDATE, REQDATE, Workflow_Due_Date, Workflow_Due_Time, Workflow_Approval_Status, Workflow_Status, Workflow_Name, Workflow_Approver, Workflow_Priority, Workflow_Originator, Workflow_Type_Name, WorkflowInstanceID, WorkflowStepInstanceID, Workflow_Step_Type, MKTOPROC, InfoValue, HOLD, DUEDATE, DISCDATE, WF_Step_Type, BCHSOURC, REQSTDBY, RequisitionDescription, RequisitionStatus, COMMNTID, USERDEF1, USERDEF2) VALUES ( @DOCDATE, @VENDORID, @VENDNAME, @CONTACT, @SOURCE, @DOCTYPE, @DOCTYNAM, @DOCNUMBR, @Other_Number, @TRXSORCE, @CNTRLTYP, @DCSTATUS, @POSTATUS, @STSDESCR, @DOCAMNT, @CURNCYID, @CURRNIDX, @PRSTADCD, @VOIDED, @PRMDATE, @REQDATE, @Workflow_Due_Date, @Workflow_Due_Time, @Workflow_Approval_Status, @Workflow_Status, @Workflow_Name, @Workflow_Approver, @Workflow_Priority, @Workflow_Originator, @Workflow_Type_Name, @WorkflowInstanceID, @WorkflowStepInstanceID, @Workflow_Step_Type, @MKTOPROC, @InfoValue, @HOLD, @DUEDATE, @DISCDATE, @WF_Step_Type, @BCHSOURC, @REQSTDBY, @RequisitionDescription, @RequisitionStatus, @COMMNTID, @USERDEF1, @USERDEF2) SELECT @DEX_ROW_ID = @@IDENTITY END set nocount off

/* Date: 01/08/2019 Time: 8:04:47 
stmt(151500104):*/
CREATE PROC ##zDP_0254704SD (@DOCDATE datetime, @DOCTYPE smallint, @SOURCE smallint, @DOCNUMBR char(21), @VENDORID char(15), @RowsAffected int OUT, @RID int = 0, @TN char(99) = 'TN') AS /* 18.00.0010.000 */ set nocount on BEGIN IF @RID > 0 DELETE FROM .##0254704 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID AND ( NOT EXISTS ( SELECT 1 FROM tempdb.dbo.DEX_LOCK WHERE row_id = @RID AND table_path_name = @TN ) ) ELSE DELETE FROM .##0254704 WHERE DOCDATE = @DOCDATE AND DOCTYPE = @DOCTYPE AND SOURCE = @SOURCE AND DOCNUMBR = @DOCNUMBR AND VENDORID = @VENDORID SELECT @RowsAffected = @@rowcount END set nocount off 
/*
/* Date: 01/08/2019 Time: 8:04:47 
SQLSTATE:(S0022) Native Err:(207) stmt(151499200):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'desSPRkmhBBCreh'.*/
/*
/* Date: 01/08/2019 Time: 8:04:47 
SQLSTATE:(00000) Native Err:(207) stmt(151499200):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:47 
SQLSTATE:(00000) Native Err:(207) status(41):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:47 
stmt(151501912):*/
SELECT TOP 25 DOCDATE,VENDORID,VENDNAME,CONTACT,SOURCE,DOCTYPE,DOCTYNAM,DOCNUMBR,Other_Number,TRXSORCE,CNTRLTYP,DCSTATUS,POSTATUS,STSDESCR,DOCAMNT,CURNCYID,CURRNIDX,PRSTADCD,VOIDED,PRMDATE,REQDATE,Workflow_Due_Date,Workflow_Due_Time,Workflow_Approval_Status,Workflow_Status,Workflow_Name,Workflow_Approver,Workflow_Priority,Workflow_Originator,Workflow_Type_Name,WorkflowInstanceID,WorkflowStepInstanceID,Workflow_Step_Type,MKTOPROC,InfoValue,HOLD,DUEDATE,DISCDATE,WF_Step_Type,BCHSOURC,REQSTDBY,RequisitionDescription,RequisitionStatus,COMMNTID,USERDEF1,USERDEF2,DEX_ROW_ID FROM ##0254704 ORDER BY DOCNUMBR ASC ,DOCDATE DESC ,DEX_ROW_ID ASC

/* Date: 01/08/2019 Time: 8:04:47 
stmt(151499200):*/
SELECT COUNT(DOCNUMBR) FROM ##0254704

/* Date: 01/08/2019 Time: 8:04:47 
stmt(151510952):*/
SELECT COUNT(DOCNUMBR) FROM ##0254704

/* Date: 01/08/2019 Time: 8:04:47 
stmt(151510952):*/
SELECT COUNT(DOCNUMBR) FROM ##0254704

/* Date: 01/08/2019 Time: 8:04:47 
stmt(151502816):*/
SELECT COUNT(DOCNUMBR) FROM ##0254704

/* Date: 01/08/2019 Time: 8:04:47 
stmt(151510952):*/
SELECT COUNT(DOCNUMBR) FROM ##0254704

/* Date: 01/08/2019 Time: 8:04:47 
stmt(151502816):*/
SELECT COUNT(DOCNUMBR) FROM ##0254704

/* Date: 01/08/2019 Time: 8:04:47 
stmt(151510952):*/
SELECT COUNT(DOCNUMBR) FROM ##0254704

/* Date: 01/08/2019 Time: 8:04:47 
stmt(151497392):*/
DROP PROC ##zDP_0184604S_1, ##zDP_0184604N_1, ##zDP_0184604F_1, ##zDP_0184604L_1, ##zDP_0184604SI, ##zDP_0184604SD

/* Date: 01/08/2019 Time: 8:04:47 
stmt(151497392):*/
DROP PROC ##zDP_0184604S_1, ##zDP_0184604N_1, ##zDP_0184604F_1, ##zDP_0184604L_1, ##zDP_0184604SI, ##zDP_0184604SD 
/*
/* Date: 01/08/2019 Time: 8:04:47 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0184604S_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:47 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0184604N_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:47 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0184604F_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:47 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0184604L_1', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:47 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0184604SI', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:47 
SQLSTATE:(S0002) Native Err:(3701) stmt(151497392):*/
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot drop the procedure '##zDP_0184604SD', because it does not exist or you do not have permission.*/
/*
/* Date: 01/08/2019 Time: 8:04:47 
SQLSTATE:(00000) Native Err:(3701) stmt(151497392):*/
*/
/*
/* Date: 01/08/2019 Time: 8:04:47 
SQLSTATE:(00000) Native Err:(3701) status(56):*/
SWSTATUS DUMP*/

/* Date: 01/08/2019 Time: 8:04:47 
stmt(151497392):*/
DROP TABLE ##0184604

/* Date: 01/08/2019 Time: 8:04:47 
stmt(151505528):*/
SELECT COUNT(DOCDATE) FROM ##1643604 WHERE ((DOCDATE<= '20190108' and DOCDATE>= '20181210'))

Thanks.

Categories:

Helpful resources

Quick Links

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,068 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,591 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans