March 11, 2002 at 6:29 am
We have a necessity to call the Rand() in a UDF.But as per SQL Server 2000, it refuses to allow the usage of RAND(), as it is non-deterministic.
Hence, we tried by using a stored procedure which has a call to the RAND() and return the subsequent random value.
This again fired back, as there is no provision to call a normal stored procedure from within a function(UDF). As SQL Server allows only functions and extended Strored Procedures to be used.
Is there a way out to get the right stuff.Kindly reply.
HTH
Ramanujam
March 12, 2002 at 5:12 am
I don't believe there is a way. If you figure out how to call an extended stored procedure so you can get its results then I have an xp I wrote for random numbers which I can provide but in BOL it looks like you cannot return the data directly back thru the xp.
quote:
The extended stored procedure, when called from inside a function, cannot return result sets to the client. Any ODS APIs that return result sets to the client will return FAIL. The extended stored procedure could connect back to Microsoft® SQL Server™; however, it should not attempt to join the same transaction as the function that invoked the extended stored procedure.
"Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy