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.
| Author |
Topic |
|
aomar
Starting Member
6 Posts |
Posted - 2008-06-12 : 09:03:22
|
| i wanna execute a stored procedure in a select and use its return typei.eselect name from table1 where id = sp 1,1i executed it and occurred an errorhelp me pls |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-06-12 : 09:28:42
|
| Have you used output parameter in the procedure?Declare @id intEXEC sp 1,1,@id outputselect name from table1 where id = @idMadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-12 : 09:29:13
|
| you cant use sps in select statements. you need to do it like this:-INSERT INTO #tempexec sp 1,1select name from table1 where id in (select id from #temp)also ensure #temp has same structure as return set of spAlternatively you can use a table valued udf in which case you can doselect name from table1 where id in (select val from udf(1,1)) |
 |
|
|
|
|
|