Optimize SP

  • Hi!

    Next, we need to unify SP 2 has a size pretty damn considerably. =)

    Let the following scenario:

    Sp [A]

    Sp

    The Sp [A] has a SELECT with 10 tables with inner join and left.

    Both [A] as are very complex and require a legal use of the server.

    Hence the question, I need a unified report of [A] and ..

    How best to run?

    Thank you.

  • I'm not sure I understand your question or your post at all.

    I think you have 2 procedures, each of them returning a result.

    You want a result that unions the result of the two procedures.

    You don't want to change the two procedures or even reuse their code as they are quite complex.

    My suggestion:

    Create a new procedure. There you call procedure A and store the result in a temporary table. Do the same calling procedure B.

    Merge the two temp tables as needed and select them to return the data.

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

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