Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Udf vs. sp
Message
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
Miscellaneous
Thread ID:
01057271
Message ID:
01057477
Views:
9
>I've been writing some complex sp's and have started to incorporate some UDF's with them. This is kind of a general question but is there any significant performance differences? I read somewhere that you shouldnt use a UDF for data access. Just trying to get some opiniolns.

David,

Like alot of things in this business, the answer is, "It depends".

I recently posted a message about my use of a UDF. There were about 1,500 records, each passing two parameters. Without a proper index, the query time was over 8 minutes. With the proper index, about 1 second.

I also did some tests using views and functions returning a table. All didn't perform as well as having the proper index on the UDF.

The simple reason being (from the execution plan) was that without the proper index, two tables were required rather than one.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform