Sujeet Raman

Sujeet Raman

  • 862
  • 927
  • 353.9k

How to loop in Stored Procedure?

Aug 27 2020 9:58 AM
 My Issue:
 
i have two student id,based on id i need to return 1 table with student dateils but i should get this table together seperately
 
id1----sp should return 1 table
id 2...2nd table 
 
I need to use this 2 temp table as a data table in c# .Now my sp returning student details in 1 temp table
 
 
 idea is like :
 
SELECT @studentid= select * FROM studenttable
for(i=0;i<studentid.lenth;i++){
 
create temptable(I) ---------------if 2 id 2 table shud return in 1 sp
 

Answers (3)