还有自定义的存储过程或函数,参数都是用户自定义的,可能来自很多表。
而且公式中可能会有条件的。
例如: 公式是: (if A >1000, 0.01, (if proc_amt('2003.01.01','2003.01.30'),0.02));不知如何得到表中每一行公式计算的结果,想来想去,不知怎么实现好,望高手指点, 谢谢!

解决方案 »

  1.   

    没有听说过,
    在存储过程中使用case when 一样可以达到你说的效果。
      

  2.   

    用动态SQL语句
    exec sp_executesql可带入参数,返回结果declare @css nchar(100), @bb intselect @bb = 29select @css = N'select @c = (@a+@b)/2'exec sp_executesql @css, N'@a int, @b int, @c int output', 10, 29, @bb output
      

  3.   

    参考:
    http://expert.csdn.net/Expert/topic/2323/2323708.xml?temp=.2692224
    http://expert.csdn.net/Expert/topic/2421/2421402.xml?temp=.9925653