I have a complex stored procedure whose results I need to retrieve in a view somehow. The end user is requesting the results to be linked in an Excel spreadsheet and I can only link views and tables in Excel.
I know you can fudge your way through this somehow using openquery but it seems like that is not a desirable way of going about this and even when I tested this, I got errors in return.
I can always dump the results into a table that's occasionally refreshed but the user is pretty intent on having this data live on demand.
The other way seems to be through a function. I tried this but no matter how I slice it I can't seem to get the function to accept a stored procedure.
CREATE FUNCTION f_testFunction
(
@Parameter INT
)
RETURNS TABLE
AS
RETURN
(
EXEC sp_testProdedure @Parameter
)
GO
Is something like the above even possible?