I have a stored procedure which is returning me about 50 columns. I want to write a query, where I will be able to select a particular column from the list of column returned by the SP.
I tried writing select RSA_ID from exec(uspRisksEditSelect '1') But Its throwing me an error.
I think we need to write some dynamic sql for it. But I am new to it.
You cannot use the results of a stored proc directly – you need to store that into an in-memory or temporary table and go from there:
But there’s definitely no need to use dynamic SQL…..