Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

UDF AND Stored Procedures Expand / Collapse
Author
Message
Posted Wednesday, October 17, 2012 12:12 AM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, May 26, 2014 5:51 AM
Points: 52, Visits: 723
Hi Guys,

I know, the question is Funny, but i want to know the details of stored procedures and UDF

I have created a Stored Procedure, i want to use the sp as like UDF
Means a UDF can be use as like "Table" we can create Joins and select a particular field,
same like UDF i want to make a use of Stored Procedure will it be Possible

if yes please provide some article for further studies

Thanks


Patel Mohamad
Post #1373638
Posted Wednesday, October 17, 2012 12:17 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, July 16, 2014 8:33 AM
Points: 2,616, Visits: 4,720
No. You cannot use a Stored Procedure like a UDF.
You can insert the results from a Stored Procedure into a temporary table and work on the temporary table further.



Kingston Dhasian

How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1373640
Posted Wednesday, October 17, 2012 12:21 AM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, May 26, 2014 5:51 AM
Points: 52, Visits: 723
Kingston Dhasian (10/17/2012)
No. You cannot use a Stored Procedure like a UDF.
You can insert the results from a Stored Procedure into a temporary table and work on the temporary table further.


Hi Kingston,

I am creating some documents on Store procedure and UDF , so i need theoretical description why we can not use stored procedure as UDF

Can you please provide some article or any document for further studies

Thanks


Patel Mohamad
Post #1373641
Posted Wednesday, October 17, 2012 12:27 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, July 16, 2014 8:33 AM
Points: 2,616, Visits: 4,720
patelmohamad (10/17/2012)
Kingston Dhasian (10/17/2012)
No. You cannot use a Stored Procedure like a UDF.
You can insert the results from a Stored Procedure into a temporary table and work on the temporary table further.


Hi Kingston,

I am creating some documents on Store procedure and UDF , so i need theoretical description why we can not use stored procedure as UDF

Can you please provide some article or any document for further studies

Thanks


I am not sure if I can get any documents based on this. I will have to Google it.
I will update the thread with links if I get one.

I could get only the below link from Google
http://social.msdn.microsoft.com/Forums/en/transactsql/thread/e699e6b9-09a5-447c-b44f-f559bff03c33
Here, the Microsoft person gives 2 reasons for the limitation



Kingston Dhasian

How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1373644
Posted Thursday, October 18, 2012 4:40 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, May 16, 2014 4:26 PM
Points: 338, Visits: 385
http://blogs.technet.com/b/wardpond/archive/2005/08/01/the-openrowset-trick-accessing-stored-procedure-output-in-a-select-statement.aspx

Maybe this can help litle bit, but is not exactly what you ask for.
Post #1374608
Posted Thursday, October 25, 2012 4:15 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 1:12 AM
Points: 2,837, Visits: 3,955
patelmohamad (10/17/2012)
I have created a Stored Procedure, i want to use the sp as like UDF Means a UDF can be use as like "Table" we can create Joins and select a particular field,
same like UDF
Any specifc reasons for it ? performance issues ??


-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done
Post #1376886
Posted Friday, October 26, 2012 8:02 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Friday, July 25, 2014 3:19 AM
Points: 4,320, Visits: 6,113
You cannot interchange UDFs and sprocs. They can be similar if they both output a variable, but you cannot "join" to the tabular output of a sproc.

Best,

Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru at GMail
Post #1377601
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse