0

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!

Community
  • 1
  • 1
Zulu Z
  • 1,103
  • 5
  • 14
  • 27
  • 1
    You cannot use non-deterministic functions like `newid()` in a user defined function. There are suggestions in this [_other question_](http://stackoverflow.com/questions/772517/newid-inside-sql-server-function) on how to work around that restriction. – Taryn Dec 12 '12 at 18:42
  • I don't see then possible solution or workaround to that problem since I cannot change the target table which uses newid in one the columns in connection with uniqueidentifier. I read I cannot call a proc from the function either... :( – Zulu Z Dec 13 '12 at 00:39

0 Answers0