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