Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

InlineFunction recompilation

$
0
0

Hi All,

I have inline table vauled functions with four input parameters. Every time i call the function with different parameters.

I need to recompile the inline function every time. Is there any way to achive this.

I called the function from one SP and iused recompile option with in proc but still the function uses the same old plan.

Detail:

Create function f1 (@c1 int, @c2 int, @c3 int)

returns table as return

(

select * from t1 where c1 = @c1 and c2 = @c2 and c3 = @c3

)

Create proc p1

as

begin

select c1, c4  from f1(10, 20, 20) -- I cant convert the function into Proc since every time i fetch different columns

end

Create proc p2

as

begin

select c4, c3  from f1(100, 2, -620)

end

So i need to recompile the function every time. How to achive this?


Please vote if you find this posting was helpful or Mark it as answered.


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>