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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 stored procedure help

Author  Topic 

haroon2k9
Constraint Violating Yak Guru

328 Posts

Posted - 2010-11-11 : 01:46:41
HI,

Can you please see this data..

PkCaseid casename Originatingcaseid Parentcaseid levelKey

96 Parentb 96 NULL 96
97 childb1 96 96 96,97
98 childb2 96 97 96,97,98
104 childb4 96 98 96,97,98,104
108 childb3 96 97 96,97,108


Lets say,

this kind of parent and creating child for this based on the parent item.k

initaily tbl has got all the parent items..we will have to create childs based on the parent..

initail row for the parent is like below (Note Pkcasedid is auto gen field - Primary key)

PkCaseid casename Originatingcaseid Parentcaseid levelKey
96 Parentb 96 NULL 96

only case name to be passed as a child to this parent item,record should be above structure..child can be n- Number for any parent item.



iam new to sql,so can you help me out on this stored procedure please...parameters are casename and parentcaseid
to be passed,,record should be inserted basedon tjis parent item..

any help would be much appreciated.

Thnaks
   

- Advertisement -