I am planning to migrate my CLR procedures from SQL 2014 to SQL 2019.
Is SQL 2019 backward compatible to host CLR written for SQL 2014 ?
Yes, SQL Server 2019 is backward compatible to host CLR written for SQL 2014. And you can change the compatibility level, see below:
The CLR integration feature is off by default in Microsoft SQL Server, and must be enabled in order to use objects that are implemented using CLR integration. To enable CLR integration using Transact-SQL, use the clr enabled option of the sp_configure stored procedure as shown:
sp_configure 'clr enabled', 1 GO RECONFIGURE GO
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Yes, but you should be aware of that starting with SQL 2017 there is something known as CLR Strict Security. (Actually, it is available on SQL 2014 as well, but only under a trace flag.)
With this setting, all assemblies are considered unsafe. (Because the mechanism in .NET SQL Server originally relied on is no longer a security boundary.) If you already have unsafe assemblies, you know which dance to get through.
There is a new mechanism to trust an assembly, though. You can can enter a hash with sp_add_trusted_assembly. You can get this hash by running hashbytes('SHA2_512') on what is in sys.assembly_files for your existing assemblies.
You can escape it by saying
sp_configure 'clr strict security', 0 RECONFIGURE
But it is nothing I recommend.
11 people are following this question.