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 2000 Forums
 SQL Server Development (2000)
 Calling procedure in select statment

Author  Topic 

khalik
Constraint Violating Yak Guru

443 Posts

Posted - 2002-01-24 : 00:53:29


i have a procedure which return a output paramater...
now i want to call( or include) the procedure in my query...

select col1,col,sp1 from table1



======================================
Ask to your self before u ask someone

fisherman_jake
Slave to the Almighty Yak

159 Posts

Posted - 2002-01-24 : 02:10:29
have you tried something like this:

exec @Return = sp1 @Param1 -- Only returns int
exec sp1 @Param1 OUTPUT -- returns a value in @Param1 any type

Select col1, col2, @Param1, @Return from table1

Does that helP??? I think in SQL2000 you can create functions you can use within your query, but I don't have SQL2000, though I've read it somewhere.



==================================================
World War III is imminent, you know what that means... No Bag limits!!!
Master Fisherman
Go to Top of Page

khalik
Constraint Violating Yak Guru

443 Posts

Posted - 2002-01-24 : 02:21:54

Thank you...Fisherman

I want the procedure to be executed for every row returned by the query (Sql Server 7)

======================================
Ask to your self before u ask someone
Go to Top of Page
   

- Advertisement -