Click here to Skip to main content
15,900,644 members
Home / Discussions / Database
   

Database

 
AnswerRe: row sum ? Pin
www.Developerof.NET30-May-08 22:13
www.Developerof.NET30-May-08 22:13 
QuestionGetDefaultConnect() in CRecordset? Pin
Le@rner30-May-08 19:31
Le@rner30-May-08 19:31 
AnswerCP NOTE Pin
leckey31-May-08 16:41
leckey31-May-08 16:41 
QuestionQuestion Regarding .Load() Pin
Jammer30-May-08 14:25
Jammer30-May-08 14:25 
QuestionUpdate Pin
Bassam Saoud30-May-08 9:41
Bassam Saoud30-May-08 9:41 
AnswerRe: Update Pin
Blue_Boy30-May-08 11:35
Blue_Boy30-May-08 11:35 
AnswerRe: Update Pin
Alsvha30-May-08 20:26
Alsvha30-May-08 20:26 
QuestionUpdate Triggers and recursion with multiple rows Pin
Steven J Jowett30-May-08 5:28
Steven J Jowett30-May-08 5:28 
I have a table similar to the following :-

Id, BigInt, IsIdentity
Name, VarChar(50)
ParentId, BigInt, Allows Nulls


Therefore I could have data as follows

Id     Name     ParentId
--     ----     --------
1      Fred     Null
2      Fred     1
3      Fred     1
4      Fred     2
5      Fred     4


Therefore data is structured as follows :-

1, Fred
..2, Fred
....4, Fred
......5, Fred
..3, Fred


What I need to do, (and this is where my weak T-SQL lets me down) is when the Name is change for row 1, an update cascades through the table and updates and related row i.e. where ParentId = Id of row updated.

My thoughts are to use an trigger on Update, but I need some help with the code.

Also, if I understand the update tigger correctly, and the option is enabled at Database level, the rows being updated by the trigger will cause the trigger to fire again, thus the update with cascade down the tree.

Any assistance is much appreicated.

Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)

AnswerRe: Update Triggers and recursion with multiple rows Pin
Rob Smiley30-May-08 13:01
Rob Smiley30-May-08 13:01 
GeneralRe: Update Triggers and recursion with multiple rows Pin
Steven J Jowett1-Jun-08 22:45
Steven J Jowett1-Jun-08 22:45 
AnswerRe: Update Triggers and recursion with multiple rows Pin
Mycroft Holmes31-May-08 2:31
professionalMycroft Holmes31-May-08 2:31 
GeneralRe: Update Triggers and recursion with multiple rows Pin
Steven J Jowett1-Jun-08 22:44
Steven J Jowett1-Jun-08 22:44 
GeneralRe: Update Triggers and recursion with multiple rows Pin
Mycroft Holmes1-Jun-08 23:17
professionalMycroft Holmes1-Jun-08 23:17 
QuestionSQL-Instead of null value I have to display the text like NO Pin
r aa j29-May-08 23:58
r aa j29-May-08 23:58 
AnswerRe: SQL-Instead of null value I have to display the text like NO Pin
Peter Josefsson Sweden30-May-08 0:43
Peter Josefsson Sweden30-May-08 0:43 
GeneralRe: SQL-Instead of null value I have to display the text like NO Pin
r aa j30-May-08 1:03
r aa j30-May-08 1:03 
AnswerRe: SQL-Instead of null value I have to display the text like NO Pin
Alsvha30-May-08 0:56
Alsvha30-May-08 0:56 
AnswerRe: SQL-Instead of null value I have to display the text like NO Pin
Giorgi Dalakishvili30-May-08 1:16
mentorGiorgi Dalakishvili30-May-08 1:16 
GeneralRe: SQL-Instead of null value I have to display the text like NO Pin
Hesham Amin1-Jun-08 12:27
Hesham Amin1-Jun-08 12:27 
AnswerRe: SQL-Instead of null value I have to display the text like NO Pin
Hesham Amin1-Jun-08 12:24
Hesham Amin1-Jun-08 12:24 
QuestionWeird nullable DateTime issue... Pin
Harvey Saayman29-May-08 21:43
Harvey Saayman29-May-08 21:43 
AnswerRe: Weird nullable DateTime issue... Pin
Peter Josefsson Sweden30-May-08 1:00
Peter Josefsson Sweden30-May-08 1:00 
QuestionGetting size of database programatically using C# or VB.NET Pin
Zerox MXI29-May-08 21:35
Zerox MXI29-May-08 21:35 
AnswerRe: Getting size of database programatically using C# or VB.NET Pin
Hesham Amin30-May-08 5:23
Hesham Amin30-May-08 5:23 
Questionun-cooperative DataSets & TableAdapters Pin
ghazanfarKhan29-May-08 8:23
ghazanfarKhan29-May-08 8:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.