Aggregate statistics

  • edit: Aggregate Query Performance Statistics

    Is there an easy way to do something like this

    begin collection

    end collection

    print collection statistics

    Something a long those lines? I have a deterministic cursor and I want to run it against a large list and have an easy way to aggregate the resulting cpu/io/etc costs for the section of code.

    If this can't be done, what's the next best way?

    Thanks 🙂

  • ideally, you just use a CTE to put the data together, and then summarize it.

    show us the cursor and the expected output, maybe we can switch it to set based logic instead.

    with MyCTE

    AS

    (

    SELECT stuff FROM WhatUsedToBeACursor

    UNION ALL

    SELECT otherstuff FROM WhatUsedToBeACursor

    )

    SELECT SUM(stuff) FROM MyCTE

    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!

  • Sorry, I had one of my typical moments when typing that up.

    I meant query performance statistics

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

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