Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Function or Stored Procedure?
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01527340
Message ID:
01527399
Vues:
24
>When you are saying, "inline table function" do you mean computed column?
>
>Also, when you are saying the "performance" problem, do you mean that if I include a scalar function in a SQL Select query, the performance of such query is relatively bad? That is, if I don't use the function, performance of the SQL Select is ok? Thank you.

In SQL Server there are 3 basic types of user defined functions:

Scalar functions (that returns a scalar expression)
Multi-line table functions (function consists of multiple statements and return a table)
Inline table-level function (function, that has only one select statement returning a table).

Unless the first two functions implemented as CLR functions, they usually don't scale too well, so the general wizdom is to avoid usage of such functions if there could be a different way to achieve the result.

The inline table function behaves like a view and this one does not suffer from bad performance.

To learn a bit more, check answers and references in responses to this SQL Server Quiz

http://beyondrelational.com/quiz/sqlserver/general/2010/questions/25/sqlserver-quiz-general-2010-adam-haines-how-can-scalar-functions-cause-performance-problems-when-used-in-the-select-list-join-expression-or-where-clause.aspx
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform