User Defined Function Question 
Author Message
 User Defined Function Question
In the following SQL2000 statement:

Select Id, Name, dbo.MyFunction(Id) as MyFunctionAlias
From MyTable
Where dbo.MyFunction(Id) <> 0

is the function run twice for every record, or is SQL2000 smart enough to
only run it once?

Steve



Sun, 28 Dec 2003 07:58:30 GMT
 User Defined Function Question

Not sure Steve, but you could test it very quickly.

Add the function, then put this query into the Query Analyzer and take a
look at the Estimated Execution plan.  It will tell you very quickly whether
or not it is run twice.

Quote:
> In the following SQL2000 statement:

> Select Id, Name, dbo.MyFunction(Id) as MyFunctionAlias
> From MyTable
> Where dbo.MyFunction(Id) <> 0

> is the function run twice for every record, or is SQL2000 smart enough to
> only run it once?

> Steve



Mon, 29 Dec 2003 08:20:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. A user defined function question

2. user defined function question

3. User defined function question

4. User-defined function question

5. call a user defined function from another user-defined function

6. Question on user defined function (SQL Server 2000)

7. Question about user-defined functions

8. Newbie questions on User-defined functions in SQL server

9. Question on user defined function (SQL Server 2000)

10. user-defined function client server question

11. questions on user-defined function

12. more question about adding values from user defined function


 
Powered by phpBB® Forum Software