SQL Server: can be stored proc, from which tables are updated from the CLR UDF

I don’t know why, but CLR User Defined Functions is not allowed to update tables.

Is there a way around this limitation by calling a stored procedure from the UDF CLR that updates the tables for it?

+3
source share
1 answer

This is not a CLR UDF, any RDBMS UDF function , by definition, cannot change the state of a database, i.e. includes:

  • DELETE, INSERT, UPDATE (i.e. DML),
  • calls the stored procedure
  • constantly change the value of the server environment variable,
  • ...
    ( , ) (, GETDATE(), NEWID() ..).

:
, SQL Server 2008 . UDF , .

:

SELECT OBJECTPROPERTY(OBJECT_ID('dbo.FunctionName'),'IsDeterministic') 
+1

Source: https://habr.com/ru/post/1770048/


All Articles