How to analyze query like that

  • Hi,

    we use an ERP program that use those kind of sql syntax.

    is there a way to run query like that in the DTA?

    or how can i replace all the @PX with the real variable?

    THX

  • yeah queries from profiler can be hell to get your arms around;

    I've formatted your query in the attachment you see; it's just a bunch of find and replaces to get each field and parameter on their own line by adding CrLf's

    there's a lot of inner joins ON 1=1, which returns a Cartesian / CROSS JOIN I believe; as far as the NAMES for @P1 thru @P31, that i can't help with.

    I don't think you asked how do much more than look at it,you can see it joins against a LOT of tables, so you might want to review indexes, but let us know what the issue is beyond getting your arms around the SQL.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • I've a performance issue with some of the queries so i want to run them in the DTA,but the DTA can't run the query like that.

    can i capture the query with profiler or other tool with out the @PX?

    i've queries that run with 50 and 60 variables.

    THX

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

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