question

MSTechie-7364 avatar image
0 Votes"
MSTechie-7364 asked ·

SQL 2014 CLR Migration to SQL 2019

Hi,

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 ?

sql-server-generalsql-server-migration
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @MSTechie-7364, We have not received a reply from you. Did the answers could help you? If there has an answer helped, do "Accept Answer". If it is not work, please let us know the progress. By doing so, it will benefit all community members who are having this similar issue. Your contribution is highly appreciated.

0 Votes 0 ·
CarrinWu-MSFT avatar image
0 Votes"
CarrinWu-MSFT answered ·

Hi @MSTechie-7364,

Yes, SQL Server 2019 is backward compatible to host CLR written for SQL 2014. And you can change the compatibility level, see below:
72356-untitled-picture.png
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

Best regards,
Carrin


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.




·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ErlandSommarskog avatar image
0 Votes"
ErlandSommarskog answered ·

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.

· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

This answer is also very good.. but i can only accept one as answer . Actually both the replies are excellent.

0 Votes 0 ·