Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Using Stored procedure in subquery

Author  Topic 

jhkeswani
Starting Member

2 Posts

Posted - 2008-11-13 : 05:11:42
I have one issue with me....
can we do so?

SELECT
column1,
column2,
(SELECT Top 1 <storedProcedure> parma1, parma2)as column3
FROM table1

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-11-13 : 05:39:02
http://sqlblogcasts.com/blogs/madhivanan/archive/2007/11/26/select-columns-from-exec-procedure-name-is-this-possible.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2008-11-13 : 07:59:46
Discounting the fact that this is a bad idea in the first place...
...what you need to do is convert the stored procedure into a user-defined function.

If it is not practically useful, then it is practically useless.
Go to Top of Page
   

- Advertisement -