Triggers and views

runswithsizzors

Well-known member
Joined
May 11, 2005
Messages
70
Location
Northern Michigan
Programming Experience
5-10
Stored Procedures and views

Hey everyone, I have a complex crystal report I am writing and I thought it would be easier to create a view. This is the first time i have done it and was wondering if I can run a stored procedure in the view as a column. I have a stored procedure that does some math that is needed in the report. If I can add that to the view then report creation will be easy.

So my question is how do I add a stored procedure to a view as a column. Or do I have to create a function that will do that?

Thanks!
 
Last edited:
Hey everyone, I have a complex crystal report I am writing and I thought it would be easier to create a view. This is the first time i have done it and was wondering if I can run a stored procedure in the view as a column. I have a stored procedure that does some math that is needed in the report. If I can add that to the view then report creation will be easy.

So my question is how do I add a stored procedure to a view as a column. Or do I have to create a function that will do that?

Thanks!

Procedures dont return values (they might modify their parameters and the values can be read afterwards but thats not the same), whereas typically a select will require that whatever intelligent code is providing a value do so as the return value.. so.. yep, yull have to create a function that:

Runs the procedure
Returns the value of the relevant OUT parameter that was modified by the proc


Then it's

CREATE VIEW vwTest AS
SELECT abc, myWrapperFUnction(def) as def, ghi...
 
Thanks for the reply, what I ended up doing is modifying my CLR stored procedure and just copied that into the function and that worked out well. Am I right when I say nested stored procedures inside of functions will not run?
 
Back
Top