hi,
how do I exec stored procedure that accept parameter and return a single value?
here is example of report
stu_id = ******
stu_name = ****
subject | marks
aa****** | call sp_mark and return student mark for that particular student id and subject
bb****** | call sp_mark and return student mark for that particular student id and subject
cc****** | call sp_mark and return student mark for that particular student id and subject
thks,
You cannot call a stored procedure per row if you mean that with your mentioned design, you would have to get all the information within one procedure to display it in the bound table.Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||
Hi Charles,
Have you tried using a user defined function in place of the stored procedure?
Simone
|||A potentially better performing alternative to a user defined function would probably be a derived table containing the marks for each student by subject. You would then join on the table.
Something like
select stu_id, stu_name, subject, mark
from students s
left outer join (select stu_id, subject, marks from marks) m on m.stu_id = s.stu_id
Of course you would need to summarize the marks into a table...
cheers,
Andrew
No comments:
Post a Comment