I can get the return value of a SQL stored procedure back like so (in T-SQL)

declare @rc int

exec @rc = dupint 10
print @rc -- 20


define proc dupint @i int
as
return @i + @i

How can I do this using SQL pass through:

?sqlexec(1, "exec ?i = dupint 20")

Also, how do I get the return value from SQL user defined function:

?sqlexec(1, "exec ?i = dbo.dupint(20)")

Any help is appreciated.

Jacobus Terhorst

Re: How to get a value back from a sql server udf... by Jacobus

Jacobus
Mon Mar 01 16:41:27 CST 2004

I found a solution:

x=0

?sqlexec(1," {?@m.x=CALL dbo.duplint(10)}")

?x && 20.00


"Jacobus Terhorst" <lanto3000@hotmail.com> wrote in message
news:uby4qy9$DHA.640@TK2MSFTNGP09.phx.gbl...
>
> I can get the return value of a SQL stored procedure back like so (in
T-SQL)
>
> declare @rc int
>
> exec @rc = dupint 10
> print @rc -- 20
>
>
> define proc dupint @i int
> as
> return @i + @i
>
> How can I do this using SQL pass through:
>
> ?sqlexec(1, "exec ?i = dupint 20")
>
> Also, how do I get the return value from SQL user defined function:
>
> ?sqlexec(1, "exec ?i = dbo.dupint(20)")
>
> Any help is appreciated.
>
> Jacobus Terhorst
>
>
>
>
>
>
>