SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Pros & Cons- Table Value Function vs Summary Table


Pros & Cons- Table Value Function vs Summary Table

Author
Message
david.holley
david.holley
SSC Veteran
SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)

Group: General Forum Members
Points: 250 Visits: 260
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.
david.holley
david.holley
SSC Veteran
SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)

Group: General Forum Members
Points: 250 Visits: 260
{Obvious newbie-ness comment deleted}
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search