[Last Call] Learn how to a build a cloud-first strategyRegister Now


Can we execute  stored procedure  inside a user defined function  in ms sql server?

Posted on 2009-02-16
Medium Priority
Last Modified: 2012-05-06
Can we execute  stored procedure  inside a user defined function  in ms sql server?

if yes, then can u give an example? is there any adverse effect ?
Question by:Tapan Pattanaik
  • 3
LVL 39

Expert Comment

ID: 23652386
No.  Only extended stored procedures.  You also cannot use dynamic SQL in a UDF.
LVL 22

Author Comment

by:Tapan Pattanaik
ID: 23656606

Can we use  stored procedure  inside a user defined function  in ms sql server?
LVL 39

Accepted Solution

BrandonGalderisi earned 500 total points
ID: 23660006
No you can't, as I stated above.  You can execute EXTENDED stored procedures, but not system or user stored procedures.
LVL 39

Expert Comment

ID: 23663423
While you may not have gotten the answer you desired, it is 100% correct and a B is not an appropriate answer.  I would ask that you "request attention" and have the grade changed.  Request Attention can be found in your original post.

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question