Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Pros & Cons- Table Value Function vs Summary Table Expand / Collapse
Author
Message
Posted Wednesday, April 17, 2013 8:07 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, October 16, 2014 7:05 AM
Points: 118, Visits: 226
For discussion...

I need to provide summary information on records in a table such as total amounts of varying types and total amounts by status. An example would be total amount of transactions pending, total amount of transactions accepted, etc. This would be across all accounts, but also at the account level so toss in there total amount of transactions pending by account.

In the past, I would go with a summary table however I'm not in a position to chase that rabbit so my thought was to do a Table Value Function that queries the table once, and then generates the totals using a Table variable.

The number of users on the front end website is very minimal (3) so the added cost of performing the calculations in memory shouldn't have that great of an impact.
Post #1443279
Posted Wednesday, April 17, 2013 8:36 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, October 16, 2014 7:05 AM
Points: 118, Visits: 226
{Obvious newbie-ness comment deleted}
Post #1443304
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse