Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Udf vs. sp
Message
From
11/10/2005 09:12:40
Keith Payne
Technical Marketing Solutions
Florida, United States
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
Miscellaneous
Thread ID:
01057271
Message ID:
01057922
Views:
9
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform