CassidyHunt
IS-IT--Management
Is there a way to maintain a subsequence in a table? For example:
There are three things I want to see. I want to be able to only increment the noteid if a note is present. Second I want to keep the noteid sequential only to the related material id. Finally I would like to be able to reorder the noteid's if a note is added later on. For example if a note is added to row 3 I would like to reorder it so 3 would appear on row 3 and 4 would appear on row 4.
Hopefully this is clear. I am thinking this can be done with an insert and update trigger but I am unsure as to how to approach a sub sequence in a trigger.
Thanks
Cassidy
Code:
ID MaterialID Description NoteID Note
-----------------------------------------------------------
1 123 Test123 1 this is a test
2 123 Another ie 2 this is good
3 123 test
4 123 try 3 adsfasdfasdf
5 124 123133213 1 asdfasdfasd
6 124 asdfasdfasd 2 asdfasdfasfda
7 125 asdfasfasdf
There are three things I want to see. I want to be able to only increment the noteid if a note is present. Second I want to keep the noteid sequential only to the related material id. Finally I would like to be able to reorder the noteid's if a note is added later on. For example if a note is added to row 3 I would like to reorder it so 3 would appear on row 3 and 4 would appear on row 4.
Hopefully this is clear. I am thinking this can be done with an insert and update trigger but I am unsure as to how to approach a sub sequence in a trigger.
Thanks
Cassidy