Cannot find the asymmetric key -- because it does not exist or you do not have permission Cannot find the asymmetric key -- because it does not exist or you do not have permission sql-server sql-server

Cannot find the asymmetric key -- because it does not exist or you do not have permission


Logins are server principals and as such they cannot be created from keys stored in user databases. You must create the key from assembly in master database:

use master;CREATE ASYMMETRIC KEY AKEY_SqlClr FROM EXECUTABLE FILE = 'C:\dlls\mySqlClr.dll';CREATE LOGIN SQLCLR_AsymKeyLogin FROM ASYMMETRIC KEY AKEY_SqlClr;