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)
 Use a stored procedure in a where clause

Author  Topic 

djshusko
Starting Member

2 Posts

Posted - 2008-02-27 : 11:15:20
I'm trying to write a stored procedure that uses a second stored procedure in its where clause. I have a stored procedure that accepts two parameters and outputs a float. What I'd like to do is have a stored procedure that accepts one parameter and has a select statement such as:
Select * from table WHERE STOREDPROCEDURE(@param1,table.field)>5

If anyone can give me some advice I'd apprectaite it. Thanks

jdaman
Constraint Violating Yak Guru

354 Posts

Posted - 2008-02-27 : 11:19:09
You cannot use a sp like this. Change your sp to a function if you intend to use it this way.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-02-28 : 02:10:56
Duplicate of http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=98037

Madhivanan

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

- Advertisement -