This is a pretty common "fix" for this problem but, Microsoft makes no guarantees that such a thing will actually work forever. Knowing how most managed code would work to do such a thing would indicate that it should work all the time, but I wouldn't be my life on it. My recommendation would be to use something that is guaranteed to return the correct elemental order index, even if it's a bit slower or more limited in what it can be fed.
Shifting gears a bit, I don't care too much for the function for another reason... it won't return a NULL if given a NULL. It returns nothing, instead.
I just can't imagine what the designers of this function where thinking considering the two major (IMHO) problems it has.
is pronounced "ree-bar
" and is a "Modenism
" for R
First step towards the paradigm shift of writing Set Based code:
________Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
"If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
"Change is inevitable... change for the better is not."
When you put the right degree of spin on it, the number 3|8
is also a glyph that describes the nature of a DBAs job. 😉
How to post code problems
Create a Tally Function (fnTally)