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)
 Using Stored Procedures in Select Query

Author  Topic 

rizwan
Starting Member

9 Posts

Posted - 2002-05-14 : 01:42:35
Dear Reader
I have a Stored Procedure named 'RtnUsers'
this Procedure returns today's users after some manuplation
I can Call it as
Exec RtnUsers '4/12/2002'

and i want to call it through select Query
Can I Do That ?
it should look like
Select * from (Exec RtnUsers '4/12/2002')

My Email Addrress
rizwan_1574@hotmail.com

Nothing

Edit by Merkin : Moving to the right forum

Edited by - merkin on 05/14/2002 01:51:39

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-05-14 : 01:52:30
If you had even taken 30 seconds to look.....this has been discussed today

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=15822



Damian
Go to Top of Page

rksingh024
Yak Posting Veteran

56 Posts

Posted - 2002-05-14 : 01:56:31
Use User-defined function.
e.g.
CREATE FUNCTION rtnUsers
(@date datetime)
RETURNS @users TABLE (u_name varchar(20),u_id int)
AS
BEGIN
--Your statements
RETURN
END
---
and then use it in select statement
SELECT * FROM rtnUsers('14 May 2002')

Ramesh Singh

Go to Top of Page
   

- Advertisement -