Hi All
Is this possible to write a store procedure in SQL server or should I use a front end tool like VB to do this. My requirement is this
I have two tables
cd table
---------------
cd
ID
Desc
Area table
-----------
Parent
Child
2. To make work easier I am creating a Temp table created with fields lets say temp
cd
id
descr
3. Then loading the data to cd,id,descr from cd table into the new table temp
insert into temp
(
cd,
id,
descr
)select
distinct cd,
id,
descr
from cd
4. Select from the area table and temp table,the parent,temp.id,test_temp.desc where temp.cd equals to
area.child.
select area.parent,temp.id, temp.desc from temp, area
where temp.bu = area.child
Ex: 210(cd)
200(parent).
5. Now the descr and ID of 200(cd) is inserted into test_temp.
6.Repeat steps 3 & 4 till pf_bu reaches 100.
Please let me know if I am not clear.
-TIA
Is this possible to write a store procedure in SQL server or should I use a front end tool like VB to do this. My requirement is this
I have two tables
cd table
---------------
cd
ID
Desc
Area table
-----------
Parent
Child
2. To make work easier I am creating a Temp table created with fields lets say temp
cd
id
descr
3. Then loading the data to cd,id,descr from cd table into the new table temp
insert into temp
(
cd,
id,
descr
)select
distinct cd,
id,
descr
from cd
4. Select from the area table and temp table,the parent,temp.id,test_temp.desc where temp.cd equals to
area.child.
select area.parent,temp.id, temp.desc from temp, area
where temp.bu = area.child
Ex: 210(cd)
200(parent).
5. Now the descr and ID of 200(cd) is inserted into test_temp.
6.Repeat steps 3 & 4 till pf_bu reaches 100.
Please let me know if I am not clear.
-TIA