Runaway query

  • Hi all,

  • well I hit the return key..here is the rest of my post. I am calling a function in a select statement. When I do the query just keeps running. If I comment out the function call everything is fine. If I call the function directly select dbo.funtionname(value) it returns a value in a mininmal amount of time. I have even limited the amount of data being looked at down to something ridiculous and still no help. Any thoughts?

  • post the code for the function?

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • Nah, got it. Way too many rows were being called. the function does a basic random number routine. You can find that code just about anywhere. I was able to use the last two digits of an identity number to create a two digit random number. This was done without using the function. With 46,000 rows the query took 32 seconds (much longer fro 100,000 + ). Without the function 146,000 rows ran in 4 seconds.

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

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