November 23, 2009 at 9:13 pm
ToddJames (11/23/2009)
Sorry Paul! How do I put it in a code window?
You wrap it in code tags: [ code ] at the beginning, [ /code ] at the end - just remove the spaces 🙂
As far as the procedure goes:
1. Take a look at Jeff Moden's article The Numbers or Tally table - and how it replaces a loop[/url]. It might give you some ideas to replace the loops you have there.
2. It's usually good to specify WITH SCHEMABINDING on functions, even if they do no data access. It can improve performance dramatically in some situations. See http://blogs.msdn.com/sqlprogrammability/archive/2006/05/12/596424.aspx
3. You can specify WITH RETURNS NULL ON NULL INPUT to return NULL if the parameter is NULL, without calling the function at all. http://technet.microsoft.com/en-us/library/ms186755(SQL.90).aspx
Paul
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
November 24, 2009 at 6:18 am
Paul White (11/23/2009)
My eyes!!!!!
It's Paul's subtlety that has endeared him to millions.
---------------------------------------------------------
How best to post your question[/url]
How to post performance problems[/url]
Tally Table:What it is and how it replaces a loop[/url]
"stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."
November 24, 2009 at 2:09 pm
jcrawf02 (11/24/2009)
Paul White (11/23/2009)
My eyes!!!!!It's Paul's subtlety that has endeared him to millions.
:laugh: :laugh: :laugh:
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
Viewing 3 posts - 16 through 17 (of 17 total)
You must be logged in to reply to this topic. Login to reply