I am using sql server 2008. I am building a website in ASP.net and querying my db. I have a table called "groups" and it contains 2 columns among several others. However only these 2 columns are of primary importance to me right now.
col1 is a string and the length of which denotes a level. Example, "GRD" denotes that this node is at level 3 because length(GRD) = 3 and so on.
col2 is also a string which is just a description , like "Grid is Open". nothing more to it.
Now this is a live site which mean that I cannot change any records in the table. However I can insert a new column in this table. I want to achieve the following:
display NEW level 2 nodes on my webpage. NEW means that I do not have them in the table yet but will need to somehow incorporate them. I cant insert a record but I can create a new column and use it. I now have a design/implementation issue as follows:
If a insert col3 with new strings in it (for the the description as in col2) how do I relate it to the col1 levels? Also I am not able to explain here but if needed please tell me if you guys need more info on the table. The col1 also has string like U" and "TH" in it to denote the code and levels 1 and 2 of the node under which my level 3 nodes would be displayed. I hope that my question is clear.
Ok... let me rephrase it.
Shall I understand you have a table where you cannot "update" but you need to somehow let the system know that a particular row has a NEW value, is that correct?
If this is correct this pretty much defines what we call SCD (Slowly Changing Dimensions) of the Type 2
The general idea is that a particular col1 row changes the value of col2 over time. SCD Type 2 solves the issue by tracking the changes and exposing the newest one by default.
Plenty of documentation in the net, just bing "slowly changing dimension type 2"
Hope this helps.
Pablo (Paul) Berzukov
Author of Understanding Database Administration
available at Amazon and other bookstores.Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.