Today, we got a very weird situation. We added a SQL login to our database server. After adding this login, SQL unloaded a critical CLR routine "due to security data definition language" (error 10310). As a result several user processed crashed. The CLRs unloaded in all the registered databases, but the new login had nothing to do with these databases. The databases using the CLR have the TRUSTWORTHY setting to on.
Any idea why creating a regular SQL login is causing this issue? It's certainly NOT a memory issue, plenty of GB available for the OS. We fixed this issue by executing TRUSTWORTHY and registering the CLR, but we're a little afraid if this happens again when adding another login.
Configuration: SQL server 2019 CU20 Enterprise, 512GB memory, 384GB for SQL
TRUSTWORTHY
isON
in the DBs containing the assemblies, but then say the issue was fixed by "executing TRUSTWORTHY". What does that mean? 3) Did you actually re-CREATE
the assemblies? 4) Did you try executing the CLR functionality again, after it got unloaded? If so, did it error? If so, what error? 4) What Login(s) own the DBs containing the assemblies? 5) Did the new Login belong to any server Roles? 6) Did assemblies get unloaded immediately upon creating the Login? 7) Have you reproduced this in non-Production environments?