Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Udf vs. sp
Message
De
11/10/2005 09:12:40
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Titre:
Divers
Thread ID:
01057271
Message ID:
01057922
Vues:
10
>Not sure if I follow you, basically what I'm doing is, initiating as sp, all the items go into a cursor, I then run through the cursor sending each item into a function that returns its tax value....I'm not sure how I could that differently...

Take the select statement that you use to build the cursor and add the logic of the tax value function as another column in the select. You may have to get very creative with nested CASE statements, correlated sub-queries, and sequence/counting tables to get the complete funtionality. Slap the query into a CREATE FUNCTION .. TABLE and the result is a table-valued function that encapsulates the tax value logic but does not suffer from the performance issues of scalar functions.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform