is there any way to use stored procedures as subqueries?
something like select * from tablename where column1value=xxx and column2value in ( exec procname, parameter1, paramter2 )
You can't use a stored procedure in a select query but you can use the following work around.
Create Table #TmpTbl (ColA datatype)
Insert #TmpTbl
Exec MySP param1,param2 /* Insert results of SP into #TmpTbl */
Select * From tablename Where col1=xxx and col2 In (Select ColA From #TmpTbl)
.
. Additional processing
.
Drop #TmpTbl Terry
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.