September 6, 2011 at 10:01 pm
HI All ,
Can any one please explain me how function will get execute internally in sql server?
With Thanks and regards,
Ravindranath.S
September 7, 2011 at 12:42 am
Much the same way as a stored procedure or ad-hoc SQL batch.
What exactly are you looking for?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
September 7, 2011 at 12:52 am
Actually my sql statment like this
SELECT DISTINCT UPP.ProductID,dbo.fnGetProductTestStatus(UPP.ProductID,@UserID) AS EndDate ,
FROM #UserProductProgression UPP
when i say like that how internally it execute inside the server .
IS that a good practice to use function like that ?
Performance wise any impact ?
September 7, 2011 at 1:03 am
IS that a good practice to use function like that ?
Performance wise any impact ?
You will have a performance impact. This is explained well here (including details on how this gets executed internally) -> http://sqlblog.com/blogs/adam_machanic/archive/2006/08/04/scalar-functions-inlining-and-performance-an-entertaining-title-for-a-boring-post.aspx
September 7, 2011 at 1:08 am
Thank you very much
September 7, 2011 at 3:48 am
ravindranath.s (9/7/2011)
Actually my sql statment like thisSELECT DISTINCT UPP.ProductID,dbo.fnGetProductTestStatus(UPP.ProductID,@UserID) AS EndDate ,
FROM #UserProductProgression UPP
when i say like that how internally it execute inside the server .
IS that a good practice to use function like that ?
Performance wise any impact ?
It really depends on what that function is doing and how well it's written the degree to which it will impact performance.
Have you looked at the execution plan for the query? That's part of how you can tell what's happening inside the system.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply