• Jeff Moden (3/14/2010)


    You can access a VIEW from a UDF. One like the following allows for the use of NEWID() in a function... Same goes for GETDATE() and a couple of other things you supposedly can't use in a UDF.

    Thanks Jeff! I had read that before, but did not make the connection. It will complicate the SELECT a bit, but I will have a go...

    The function will be non-deterministic of course, but that's kinda the point I suppose.

    Shame though, because the optimizer really hates non-deterministic things.