I am getting the following error when trying to create a table with computed column that points to a function:Computed column 'JobNumber' in table 'SB_B_JobT' cannot be persisted because the column is non-deterministic. Can anybody tell me if there is a work around for this issue. Please note that I have tried CAST and CONVERT on the computed column. Also have tried SchemaBinding. Here are my scripts --Sample sequence object CREATE FUNCTION dbo.GetNextJobNumber(@companyId bigint, @branchId bigint) SET @sqlStatment = N'SELECT @nextNumber = NEXT VALUE FOR JobNumber_' + CONVERT(varchar(5), @companyId) + '_' + CONVERT(varchar(5), @branchId) EXEC SP_EXECUTESQL @sqlStatment, N'@nextNumber bigint OUTPUT', @nextNumber OUTPUT RETURN (CONVERT(bigint, @nextNumber))
|
↧
Computed column 'the_column' in table 'the_table' cannot be persisted because the column is non-deterministic
↧