Inlining Scalar UDFs

  • Comments posted to this topic are about the item Inlining Scalar UDFs

    Gregory A. Larsen, MVP

  • Why can't you take the meaningless loop out of Function 5 and make it inline?  There's no point in counting up from 0 until you reach the parameter value.  Just rewrite it to look for the @RatingID.

    Also, what is the point of creating the table variable in Function 4?  Just query against the Rating table joined to Customer, and it can be inline.

     

     

  • GaryV wrote:

    Why can't you take the meaningless loop out of Function 5 and make it inline?  There's no point in counting up from 0 until you reach the parameter value.  Just rewrite it to look for the @RatingID.

    Also, what is the point of creating the table variable in Function 4?  Just query against the Rating table joined to Customer, and it can be inline.

    GaryV wrote:

    Why can't you take the meaningless loop out of Function 5 and make it inline?  There's no point in counting up from 0 until you reach the parameter value.  Just rewrite it to look for the @RatingID.

    Also, what is the point of creating the table variable in Function 4?  Just query against the Rating table joined to Customer, and it can be inline.

    It wouldn't work because then the answers to the question would change.

     

  • One of the correct answers is Function 2, but I don't see that one. I only see 1, 3, 4 and 5.

    Edit: Mea Culpa, it's not labeled like the others.

    • This reply was modified 4 years, 6 months ago by  gary.rumble.

    14090 SW TENNESSEE LN

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply