SQL Server Performance

Can we Call a Stored procedure inside a function...?

Discussion in 'SQL Server 2008 General Developer Questions' started by vishnuvaddi, May 22, 2009.

  1. vishnuvaddi New Member

    Can we Call a Stored procedure inside a function ? .. I saw so many posts saying that it is not possible to call a SP inside a function... ? I dont know, what is the reason ..? can Any one please help me on the reason.
    I had just seen a post saying that it is possible to call SP's in functions.. stating that only Extended SP can be used not user defined SP's.
    Why is it so only Extended SPs..?
    Thanks in advance,
    Vishnu Vaddi.
  2. Adriaan New Member

    Point is that by definition a UDF cannot make changes to existing data. When calling out to an SP, there's always the possibility of the SP making such changes.
    Those are the rules, you'll just have to live with them. If you think UDFs are the probably the best feature of SQL Server, you need learn to unlearn some of that programmer's thinking, and start thinking more like a database developer.[:D)

Share This Page