CLR strict security is on by default in SQL 2017 and later versions. The proper approach is to follow the recommendations detailed in the error message you received so that the assembly can be created. Your other option is to disable the CLR strict security option but that is not recommended per the documentation.
CREATE ASSEMBLY for assembly is not trusted : SQL 2019

Padmanabhan, Venkatesh
241
Reputation points
Hi .
I am using SQL Server 2019. I am trying yo add an assembly in SQL. The code works fine in SQL 2016, but errors out in 2019 with the below error :
"CREATE ASSEMBLY for assembly 'ABC.MSSQL' failed because assembly 'ABC.MSSQL' is not trusted. The assembly is trusted when either of the following is true: the assembly is signed with a certificate or an asymmetric key that has a corresponding login with UNSAFE ASSEMBLY permission, or the assembly is trusted using sp_add_trusted_assembly."
How to fix this ?
If the error message is to be believed, you need to add
HI.
Thanks. Should this be added in the first SQL or second ?
I like to point that while you can get answers in a forum, you are in no way prohibited to think for yourself. Where do you think the command fits in? And moreover, did you try it?
Apologies. Thanks , I will try and provide the feedback
Sign in to comment