Possible Duplicate:
newid() inside sql server function
I have to return a value based on parameter from the function which looks into the table and when it's null insert into this table new record. Unfortunately I'm getting this funny error: invalid use of side-effecting operator 'newid' within a function
Is there a work around providing I cannot change the target table? Working on SQL Server 2008 thanks!