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 2008 Forums
 Transact-SQL (2008)
 query procedures

Author  Topic 

inbs
Aged Yak Warrior

860 Posts

Posted - 2011-05-30 : 05:13:34
i have a procedure that returns some values

how can i query the output?

exec sp_test 'a','b'

i get
1
2
3
4

i want to ask
if the output =4 than print 'yes' else 'no'

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-05-30 : 05:37:34
declare @t table(col int)
insert into @t
EXEC sp_test 'a','b'

select case when col=4 then 'yes' else 'no' end as status from @t

Madhivanan

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

- Advertisement -