SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


UDF AND Stored Procedures


UDF AND Stored Procedures

Author
Message
patelmohamad
patelmohamad
SSC-Enthusiastic
SSC-Enthusiastic (107 reputation)SSC-Enthusiastic (107 reputation)SSC-Enthusiastic (107 reputation)SSC-Enthusiastic (107 reputation)SSC-Enthusiastic (107 reputation)SSC-Enthusiastic (107 reputation)SSC-Enthusiastic (107 reputation)SSC-Enthusiastic (107 reputation)

Group: General Forum Members
Points: 107 Visits: 765
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
Kingston Dhasian
Kingston Dhasian
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3687 Visits: 5177
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/
patelmohamad
patelmohamad
SSC-Enthusiastic
SSC-Enthusiastic (107 reputation)SSC-Enthusiastic (107 reputation)SSC-Enthusiastic (107 reputation)SSC-Enthusiastic (107 reputation)SSC-Enthusiastic (107 reputation)SSC-Enthusiastic (107 reputation)SSC-Enthusiastic (107 reputation)SSC-Enthusiastic (107 reputation)

Group: General Forum Members
Points: 107 Visits: 765
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
Kingston Dhasian
Kingston Dhasian
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3687 Visits: 5177
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/
adrian.facio
adrian.facio
SSC-Addicted
SSC-Addicted (438 reputation)SSC-Addicted (438 reputation)SSC-Addicted (438 reputation)SSC-Addicted (438 reputation)SSC-Addicted (438 reputation)SSC-Addicted (438 reputation)SSC-Addicted (438 reputation)SSC-Addicted (438 reputation)

Group: General Forum Members
Points: 438 Visits: 386
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.
Bhuvnesh
Bhuvnesh
SSCertifiable
SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)

Group: General Forum Members
Points: 5200 Visits: 4076
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;-)
TheSQLGuru
TheSQLGuru
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12303 Visits: 8546
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 on googles mail service
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search