I have a stored proc and I am trying to select all rows from it.
SELECT * FROM dbo.SEL_My_Func 'arg1','arg2','ar3'
didnt work. So I also tried:
SELECT * FROM EXEC dbo.SEL_My_Func 'arg1','arg2','ar3'
but this also didnt work. How do I get to test my stored proc returns correct results?
I have had to use a proc, rather than a function because I have an ORDER BY as part of the SQL, see: Selecting first row per group
Lastly, am I right in thinking there is no problem limiting which columns are returned from the stored probc, you just cant specify which rows (otherwise you would be better using a SQL function)?