Saturday, February 25, 2012

Call a store procedure from inside a function

Hello,
I am having a problem where I'm trying to call a store procedure from a
function, is it possible ?
JHello,
Sorry no can do, you can't call a store procedure from a function, sorry.
Peter
"Although prepared for martyrdom, I preferred that it be postponed."
Winston Churchill
"Julie" wrote:

> Hello,
> I am having a problem where I'm trying to call a store procedure from a
> function, is it possible ?
> J|||Dang, ok thanks Peter
J
"Peter 'Not Peter The Spate' Nolan" wrote:
> Hello,
> Sorry no can do, you can't call a store procedure from a function, sorry.
> Peter
> "Although prepared for martyrdom, I preferred that it be postponed."
> Winston Churchill
>
> "Julie" wrote:
>|||No, this is documented in Books Online. There are a number of things that yo
u aren't allowed in a
UDF. Calling regular stored procedures is one of them (xp_'s are OK, though.
.).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Julie" <Julie@.discussions.microsoft.com> wrote in message
news:8D15C2A0-4A65-47ED-BAA1-6F8814C13DFC@.microsoft.com...
> Hello,
> I am having a problem where I'm trying to call a store procedure from a
> function, is it possible ?
> J|||No, it isn't possible. How about moving the logic out of your proc into
the function itself.
David Portas
SQL Server MVP
--|||Hi,
I think you can if you call the proc from within an openquery. But thats not
really in the spirit of what funstions are supposed to be for. Still, if its
really really necessary...
N
"David Portas" wrote:

> No, it isn't possible. How about moving the logic out of your proc into
> the function itself.
> --
> David Portas
> SQL Server MVP
> --
>

No comments:

Post a Comment