I have an existing C# CLR runtime function that I am using with SQL Server 2012. I would like to set the IsDeterministic and SCHEMABINDING options on this function so I can use it for persisting a computed column in a table.
Here is the alter statement:
ALTER FUNCTION [dbo].[authorityFromURI](@URI [nvarchar](4000))
RETURNS [nvarchar](4000) WITH EXECUTE AS CALLER
AS
EXTERNAL NAME [KDPSqlServerProject].[UserDefinedFunctions].[authorityFromURI]
How should this alter statement be modified to set these options?
You have to set the IsDeterminstic property within the function code itself, e.g
To make it schemabinding:
That said, I haven’t tested these options together with persistence…