Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 handling recursion in a self-referencing sql table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-03-17 : 06:22:42
Gerald writes "You guys have been a great help to date. However, I am not sure this scenario is possible using SQL. Hopefully one of you has come across a possible solution to this scenario:

Boss has a pricing spreadsheet whose values looks like this:

|Area1 |Area2 |Area3 |...
Item# |Price |Price |Price |...
-----------------------------------
BaseCol| |Area1 |Area2 |...
Multval| 0 | 1.05 | 2.00 |...
123 |$1.00 |$1.05 |$2.10 |...
124 |$2.00 |$1.10 |$2.20 |...
.

where there are some areas that have base pricing, and other areas whose pricing is based on multiplying the price of another area by a certain amount (ie area2 = area1 * 1.05 and area3 = area2 * 2.0)

There are other complexities of course (ie some cells will have their own multiplier which overrides the columns existing multiplier, some will have override values instead of multipliers) but am not worried about those for now.

Boss wants to get rid of the spreadsheet and implement a SQL based webpage that has the same functionality as the spreadsheet. This would allow pricing to be viewed/modified by many people without anyone being worried that someone might have an obsolete version of the spreadsheet/pricing.

Boss also wants to only show a subset of the data (ie some users will only have access to some area pricing info and not others).

Because of the data volume (a hundred or so columns by thousands of rows), dont think I can simply stored formulas in SQL and have a spreadsheet object in the webpage that contains those formulas.

So this leaves me, I think, with a problem. How do I display the pricing for all the items for a one or more areas in a quick way AND be able to handle a record whose value depends on another record whose value may depend on another record whose value many depend on another record ... and so on. For example:

area15 = area12 * 1.5
area12 = area10 * 1.1
area10 = area9 * 1.12
area9 = area 7 * 1.01
...

for any unknown number (one or more) of levels.

Any help (or pity) appreciated."
   

- Advertisement -