store proc logic

  • Logon IN (SELECT CWOPALogin FROM Users U

      inner join UsersFileTypes UF ON U.UserId=UF.UserId

      inner join

  • Follow the dependencies.

    That error is something you've explicitly coded. You've coded it to occur, based on this condition:

    IF @Logon IN (SELECT CWOPALogin FROM Users U

      inner join UsersFileTypes UF ON U.UserId=UF.UserId

      inner join FileTypes FT ON UF.FileTypesID=FT.FileTypesID

      WHERE @BusArea=FT.BusinessAreaNumber

      and   @PayId=FT.PaymentID)

    This condition is dependent upon on the variables @BusArea and @PayId.

    The variables @BusArea and @PayId are dependent upon SELECT statements that query the SIRSInput table.

    The SIRSInput table data is dependent upon your stored procedure executing at least once and populating it via the BULK INSERT.

    In other words, the first time you run this, you are populating a table which changes how a certain condition evaluates on the 2nd and subsequent executions.

     

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply