sql - Put a where clause around a stored procedure I cannot edit -
this question has reply here:
sql server - select stored procedure 11 answersi have stored procedure not have access edit called [usp_itemsanddescriptions].
this gives result, , phone call looks this:
use [eboghandel] go declare @return_value int exec @return_value = [dbo].[usp_itemsanddescriptions] @startdate = n'2014-06-01', @enddate = n'2014-06-19', @top = 10000 select 'return value' = @return_value go this stored procedure gives list of fields. 1 of fields called pressdescription.
now want create where statement, say:
select * mystoredprocedureresult mys mys.pressdescription = '1' what syntax this? not have access edit stored procedure unfortunately, though optimal.
you should load homecoming info sp temporary table , filter table clause:
create temporary table:
create table #tmp ( ... ) insert info in table
insert #tmp exec usp_itemsanddescriptions @startdate = n'2014-06-01', @enddate = n'2014-06-19', @top = 10000 filter data
select * #tmp mys mys.pressdescription = '1' also check link - there lot of methods load info sp how select * [temp table] [stored procedure]
sql sql-server stored-procedures
No comments:
Post a Comment