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
 Query Execution

Author  Topic 

thanvi
Starting Member

11 Posts

Posted - 2007-01-23 : 19:46:40
I have a query like this:

SELECT *,isnull(dbo.fn_1(a),'') f_a,
isnull(dbo.1(b),'') f_b FROM tablea with(nolock)
WHERE ID = 12345 and ID<10000000 and dbo.fn_1(7)='asdfasdf' and Active='Y'

Does it effect performance as i am using a udf here? Also let me know the order in which the conditions will be applied.

Thanks in advance.
Thanvi

nr
SQLTeam MVY

12543 Posts

Posted - 2007-01-24 : 04:24:42
You can't tell the order.

As the udf is just using static data it shoud be executed once and the result used in the query so should not affect performance much.
By nature udf's are quite slow and if it was using as input a column then it would force row by row processing and could cause a large impact.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -