• Lynn Pettis (3/18/2013)


    opc.three (3/18/2013)


    ChrisM@Work (3/18/2013)


    opc.three (3/15/2013)


    PS Forgot to mention the function is undocumented so take that into consideration.

    It's a cough scalar function too.

    Meh. We're talking about SQL Agent data so IMHO it's not something to get in a twist over (or even having a cough over) 😀

    Actually, the OP never did say if it was SQL Agent data that he was working with here. It could actually be data in his application database.

    Well, gee, I was thinking that was implied given the format of the data and was validated by the fact that the OP latched onto the msdb proc when replying directly to me, but you have a valid point. He could have been talking about data in an application database, or come to think of it, he could also have a shedload of historical data in his SQL Agent history tables but that would likely point to job-history maintenance issue.

    @naveen.pasupuleti, could you tell us if you're applying this to SQL Agent data stored in msdb, or some other type of data source where you could be evaluating a non-trivial number of rows?

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato