Forum Replies Created

Viewing 15 posts - 2,791 through 2,805 (of 4,080 total)

  • RE: Are the posted questions getting worse?

    I just did.

    Ahahahahahahahaaaaaaaaaaaaaaa............. 😀

    Forgive the cruel cackle of evil amusement.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Are the posted questions getting worse?

    Lynn, I usually make it a point to avoid looking at any questions with his name on it. It preserves the serenity of my own personal desert....

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Rounding a number

    And already answered.....

    Lynn, do you realize we're almost at 5k elsewhere?

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Rounding a number

    Hi.

    How's it going?

    😀

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: T-sql procedure error in job

    But, as I said in the original post, if I run this proc as a job within SQLServer Enterprise Manager (v8), then it always fails with the following message...

    Executed as...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: How do you select top 10 for each unique key?

    Very nice little summary, John. Thank you.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: How do you select top 10 for each unique key?

    Shhhhhh.... 😉

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: How do you select top 10 for each unique key?

    The imprecision was what troubled me. But it makes sense if you want to keep "ties". I assume that the optimizer has to do a...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: How do you select top 10 for each unique key?

    Mr. Wilbur said RANK()

    rank() over (partition by s.objtype order by (s.usecounts) desc) as UCRank

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: How do you select top 10 for each unique key?

    Arrrgg! Flo, I just realized I never proofed your article!

    I probably shouldn't have thrown the CROSS_APPLY suggestion in. Row_Number() with partitioning is quite quick for...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: PIVOT QUERY HELP NEEDED

    you want your dynamic SQL to dynamically create a the final column as

    ( [Date1] + [Date2] + ... [DateN] ) AS RowTotal

    Now how could we do this? ...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: multiple criteria and multiple columns in SELECT statement using one table

    TomYum,

    If you are going to continue to code in SQL, you need to very quickly read up on JOIN in all it's forms. It's absolutely essential. ...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: How do you select top 10 for each unique key?

    Bruce, how does the RANK approach differ from ROWNUMBER()?

    Also, I don't believe that CROSS APPLY will always do a subquery per row. The optimizer may surprise you.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: How do you select top 10 for each unique key?

    Or maybe...

    ;with distinctObjTypes as

    (SELECT DISTINCT objtype FROM sys.dm_exec_cached_plans)

    --

    SELECT d.objtype,ca.*

    FROM distinctObjTypes d

    CROSS APPLY

    (SELECT top 10 usecounts, cacheobjtype, plan_handle

    FROM sys.dm_exec_cached_plans

    WHERE ca.objtype = d.objtype

    ORDER BY USECOUNTS DESC) ca

    --

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Are the posted questions getting worse?

    Calm you must be, Lynn. Dwell on them you should not.

    For though their numbers are legion they are not strong in the Force.

    Hey Bruce...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

Viewing 15 posts - 2,791 through 2,805 (of 4,080 total)