Stored Provcedure question...

  • hi guys

    i have this stored procedure

    --

    exec dbo.rpt_HS_BedsMI @insurer=@ins, @lwrDate=@lowerDate, @uprDate=@upperDate

    exec dbo.rpt_HS_Breakdown @insurer=@ins, @lwrDate=@lowerDate, @uprDate=@upperDate

    exec dbo.rpt_HS_BuildAreaMI @insurer=@ins, @lwrDate=@lowerDate, @uprDate=@upperDate

    exec dbo.rpt_HS_BuildCTypeMI @insurer=@ins, @lwrDate=@lowerDate, @uprDate=@upperDate

    exec dbo.rpt_HS_BuildNCBMI @insurer=@ins, @lwrDate=@lowerDate, @uprDate=@upperDate

    exec dbo.rpt_HS_BuildSIMI @insurer=@ins, @lwrDate=@lowerDate, @uprDate=@upperDate

    exec dbo.rpt_HS_BuildTypeMI @insurer=@ins, @lwrDate=@lowerDate, @uprDate=@upperDate

    exec dbo.rpt_HS_BuildYAGE @insurer=@ins, @lwrDate=@lowerDate, @uprDate=@upperDate

    exec dbo.rpt_HS_ContAreaMI @insurer=@ins, @lwrDate=@lowerDate, @uprDate=@upperDate

    exec dbo.rpt_HS_ContCtypeMI @insurer=@ins, @lwrDate=@lowerDate, @uprDate=@upperDate

    exec dbo.rpt_HS_ContNCBMI @insurer=@ins, @lwrDate=@lowerDate, @uprDate=@upperDate

    exec dbo.rpt_HS_ContSIMI @insurer=@ins, @lwrDate=@lowerDate, @uprDate=@upperDate

    exec dbo.rpt_HS_CtypeMI @insurer=@ins, @lwrDate=@lowerDate, @uprDate=@upperDate

    exec dbo.rpt_HS_PAgeMI @insurer=@ins, @lwrDate=@lowerDate, @uprDate=@upperDate

    exec dbo.rpt_HS_PCodeMI @insurer=@ins, @lwrDate=@lowerDate, @uprDate=@upperDate

    i want to run it again after its run the first time excluding all the Claims and just running the

    "exec dbo.rpt_HS_BedsMI @insurer=@ins, @lwrDate=@lowerDate, @uprDate=@upperDate" to do this can i just write at the bottom of the procedure "Else begin" ? and then make the statement?

    thanks in advance.

  • you can create a SP which will call other SP based on your if, else condition

    ----------
    Ashish

  • Hi

    Agree with 'learningforearning

    Ali
    MCTS SQL Server2k8

  • So, why don't you just put "exec dbo.rpt_HS_BedsMI @insurer=@ins, @lwrDate=@lowerDate, @uprDate=@upperDate" at the end of what you've got?

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

Viewing 4 posts - 1 through 3 (of 3 total)

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