Sunday, March 11, 2012

Calling a function inside of a function is not allowed in sql server?

We have a stored procedure that generates a unique random integer which uses
the RAND function. For data columns, you can invoke a function to create a
default value .e.x.: NEWID(). I would like to call a function that will
perform the same operations as the stored procedure.
The sql guru here says he tried to make our stored prodecure a function but
wasn't able to because sql server2k wouldn't allow him to use RAND inside
the function. Does anyone know of any workarounds, will future verions of
sql server allow this?
Thx in advance.
Pass RAND() into the function (this is much the same as GETDATE()). Look up
DETERMINISTIC and NONDETERMINISTIC. See http://www.aspfaq.com/2439
http://www.aspfaq.com/
(Reverse address to reply.)
"Hasani (remove nospam from address)" <hblackwell@.n0sp4m.popstick.com> wrote
in message news:uK2Qeh1lEHA.3496@.TK2MSFTNGP12.phx.gbl...
> We have a stored procedure that generates a unique random integer which
uses
> the RAND function. For data columns, you can invoke a function to create a
> default value .e.x.: NEWID(). I would like to call a function that will
> perform the same operations as the stored procedure.
> The sql guru here says he tried to make our stored prodecure a function
but
> wasn't able to because sql server2k wouldn't allow him to use RAND inside
> the function. Does anyone know of any workarounds, will future verions of
> sql server allow this?
> Thx in advance.
>
|||Works great, THX!!!!!!!
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:uWRx%23m1lEHA.3432@.TK2MSFTNGP14.phx.gbl...
> Pass RAND() into the function (this is much the same as GETDATE()). Look
> up
> DETERMINISTIC and NONDETERMINISTIC. See http://www.aspfaq.com/2439
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Hasani (remove nospam from address)" <hblackwell@.n0sp4m.popstick.com>
> wrote
> in message news:uK2Qeh1lEHA.3496@.TK2MSFTNGP12.phx.gbl...
> uses
> but
>

No comments:

Post a Comment