September 8, 2009 at 10:25 am
I have a SP that has 3 parameters
getservicecontractsinfo 'ALL', '2009-09-01', '2009-09-30'
I want to call this SP in a SQL statement so that I could filter the data or sort data...
Thanks
September 8, 2009 at 10:32 am
You can insert the results into a table and then work with the table.
CREATE TABLE x(
the fields and datatypes your sp returns...
)
INSERT INTO x(fields)
EXEC getservicecontractsinfo 'ALL', '2009-09-01', '2009-09-30'
SELECT ...
FROM x
WHERE ...
ORDER BY ...
September 8, 2009 at 12:11 pm
Another alternative is to rewrite your stored procedure as a table-valued function.
select * from dbo.tfn_YourFunction(parm1,parm2,parm3)
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply