DECLARE @EmailEnc varbinary(maX)
declare @keyid uniqueidentifier
DECLARE @Email_test nvarchar(max)
set @Email_test = N'Sg@hotmail'
SELECT top 1 @keyid=[key_guid] FROM sys.symmetric_keys order by newid()
SET @EmailEnc=CAST(ENCRYPTBYKEY(@keyid,@Email_test) AS varbinary(max))
select @Email_test,@keyid,@EmailEnc
结果
Sg @ hotmail D790AE00-63FC-4BC5-8182-073BACDF1B12 空值 (1排受影响) 为什么空?任何想法??