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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-03-15 : 00:19:34
|
Sergio writes "My question is a combination of ItemID=2029 and ItemID=1602. Let me setup my situation. Table [Products]( [ProdID] [int] IDENTITY (1,1) [ParentID] [int], [Description] [varchar](75), [Price] [float], [IsCategory] [bit])
In this table, products are associated to categories. They are distinguish by [IsCategory]. I need to update [Price] where [ProdID] is in a category (ParentID = IsCategory/ProdID). The rub is that there will be subcategories and subcategories of subcategories, ... I see this as a recursive stored proc but How do I recursively UPDATE [Price]? I understand the Temporary Table example and Threaded Message Board Query but I need to somehow merge these.
I will be passing the main CategoryID [ProdID] and amount to change [Price] by. Thank you for your assistance.
OS:Windows 2000 Server ~ MS Sql 7 Server sp3
Regards,
sergio@radicalage.com" |
|
|
|
|
|