Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 improve performance in case of scalar functions

Author  Topic 

mirza21
Starting Member

11 Posts

Posted - 2011-06-23 : 15:35:48
hi

I have select statment in which i have scalar function
.Each time A row is fetched scalar function is executed . I have 1000000 records in table so it is causing performanc issues. I have tried using sub query in place of scalar function even then it perfomance is bad . Please suggest me a better alternative

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2011-06-23 : 16:06:19
If you can post the relevate information we might be able to offer a set-based solution. Here is a link that might helk you prepare said information:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2011-06-24 : 01:32:00
Let us know the query and scalar function details. Is the scalar function happening on the WHERE clause?
Without knowing the exact details a practical suggestion is to change the scalar function to a table valued function.

But priority should be given to implementing a set based solution

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
   

- Advertisement -