I keep getting this error: Any Ideas? Invalid use of side-effecting or time-dependent operator in 'newid' within a function. I am working with Ms-sql 2005
Create Function [dbo].[GetNewNumber]( )
RETURNS int
AS
BEGIN
Declare @code int
set @code = (SELECT CAST(CAST(newid() AS binary(3)) AS int) )
RETURN (@code)
END