>>No, can you please just run the 3 together - this way we'll see how much % each cost.
>>
>>You can also try
>>
>>declare statements
>>
>>set statistics time on
>>
>>my query
>>
>>boris
>>
>>UDF
>>set statistics time off
>
>In order as mentioned:
>
>(93 row(s) affected)
>
> SQL Server Execution Times:
> CPU time = 0 ms, elapsed time = 0 ms.
>
>(93 row(s) affected)
>
> SQL Server Execution Times:
> CPU time = 0 ms, elapsed time = 0 ms.
>
>(93 row(s) affected)
>
> SQL Server Execution Times:
> CPU time = 16 ms, elapsed time = 186 ms.
Ok, this proved that UDF is the slowest thing and inline functions are much better using CROSS APPLY technique. Looks like George may want to update his blog.
BTW, take a look at the new variation I posted - I think Brad's code is easier to read than mine.
If it's not broken, fix it until it is.
My Blog