Here are some thoughts to get you started:
First, SQL Server is not really well-set up to receive a table name as a parameter and base the queries on that. You could do it using DYNAMIC queries, but unlike in C# where dynamic keyword evokes pleasant feelings of run time type determination and such, dynamic queries in SQL are something that people try to avoid for a number of reasons.
So assuming that you want to stick with a real table name, calculating the totals would be as simple as this:SELECT
SUM(Price) AS PriceTotals,
SUM(Tax) AS TaxTotals,
SUM(Tip) AS TipTotals
FROM
YourTable;
You can group by various categories if you like - for example, if you have different locations, you could group them by locations to see the totalprice, totaltax and totaltips in each location.
Now that you have the sums, inserting that into a new table is really simple - just modify it as follows:INSERT INTO YourTotalsTable
(PriceTotals, TaxTotals, TipTotals)
SELECT
SUM(Price) AS PriceTotals,
SUM(Tax) AS TaxTotals,
SUM(Tip) AS TipTotals
FROM
YourTable
This assumes that the "YourTotalsTable" already exists.