SQL Server Performance Forum – Threads Archive
calling a user-defined function in a query
Hi all… I have a query ehich without my user-defined function it returns resultset very fast(in query analyzer) but as i call it in my query it slows down….this is my syntax:: =====my user-defined function=====dbo.fn_Studcount
================================== =====my query without the function=========
select x,y,z
from t1,….
=========================================== =====my query with the function=======
select x,y,dbo.fn_Studcount(x) as sc
from t1,….
====================================== how can I improve the speed of running my query with my function? tanks alot
What the function is doing exactly and how many rows are returned from t1 table.
How many rows are there in t1 table.
Please post the code of the UDF. —
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
Ich unterstütze PASS Deutschland e.V. http://www.sqlpass.de)
]]>