How can i pass different decimal values to a same function

  • Hi,

    I want to write a function which accepts variable fo type decimal as a parameter. What i wanted to do is instead of hardcoding precision and scale in function definition can i do something that accepts all decimal values with any precision and scale?

    Thanks & Regards,

    Bhavi

  • Unless you create an Extended Stored Procedure to create dynamic sql thru and submit the value as a varchar(39) then you cannot. The requirement to deal with an undefined datatype that could be altered dynamically means you would have to build dynamic SQL, but as you cannot use EXECUTE to build and get your value back you would have to use sp_executesql, but Stored Procedures are not allowed inside Functions in 2000 but Extended SPs are, so to accomplish you would have to build an XP that does the job.

Viewing 2 posts - 1 through 2 (of 2 total)

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