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 - 2006-02-10 : 09:56:28
|
| Dror writes "Hello,I am a beginner to triggers. Using MS SQL Server.I have a forum that I wrote 2 years ago.It has 70,000 records. The forum uses a table named Opinion.The records have a ID, fatherID, IsFather.I have added a new field "threadID".The records now have a ID, fatherID, IsFather, threadID.I want to store in threadID the root entry of the thread - this is the first ID the first (ancient father) message in a topic gets.I want to recognise all the relevant records from each record in a discussion. All threads will have the uniq ID.I think of using a triger but I am new to that.1. if a record is updated and ID = ThreadID and ISfather=12. update all child records SET ThreadID = Father's.ThreadIDor 1. if a record is updated ThreadID = 02. update all child records SET ThreadID = Father's.ThreadIDthis will cause a recursive update to all child records.ThanksDror" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|