This is the code for stroed procedure what i wrote..
This will fetch a set of ids from a table say table1
it will then loop through all the ids and compare each id with accountid field in other tables like table2 , table3 and grab all the id fields from table2 and table3 . and then insert those entries. tell me what is wrong in ths stored procedure