Sean Lange (6/20/2013)
ali.m.habib (6/20/2013)
Sean Lange (6/20/2013)
ali.m.habib (6/20/2013)
I have stored prcuder like
create proc calcaulateavaerage
@studentid int
as
begin
-- some complecated business and query
return @result -- single decimale value value
end
and then I want to
create proc the whole result
select * , ................................ from X where X.value > (calcaulateavaerage X.Id)
it always give error muli part identifier calcaulateavaerage couldn't be bound any idea how to solve that
You can't use a stored proc like that. You would have to first execute calculateAverage and store the results, then you can reference it.
How to store it please , U mean in #table , but the main proc contains sum and many other complicated staf
I can't provide much assistance here because I have no idea what your code looks like or what you are trying to do.
in the main sp I calacualte the sum of the subjects compare it to another lookup table , then do another sum and get the difference
I need to use this outptut in anothe stored procdeure