/*允许程序使用外部程序集*/ EXEC sp_configure 'clr enabled', 1 RECONFIGURE WITH OVERRIDE
/*产生hash签名*/ DECLARE @hash AS BINARY(64) = (SELECT HASHBYTES('SHA2_512', (SELECT * FROM OPENROWSET (BULK 'D:\Function.SQL.dll', SINGLE_BLOB) AS [Data])))
/*加入信任程序集*/ exec sp_add_trusted_assembly @hash
/*查看已添加的信任程序集*/ select * from sys.trusted_assemblies
/*删除信任程序集*/ declare @hash2 BINARY(64)=0x000000 exec sp_drop_trusted_assembly @hash2