Sean Lange (2/15/2013)
I converted this into an inline table value function like this.
Careful now. That's not an "inline" TVF. That's a "multiline" TVF. An iTVF must be a single query much like you'd write a view.
--Jeff Moden
Change is inevitable... Change for the better is not.