• Geno, thanks for your kind words.  To your point, it might be nice if it worked that way, but in fact SQL does not encrypt same sequence of characters to the same encrypted value.  Use your code to check this for yourself:

    open symmetric key MyKey decryption by certificate MyCert;

    DECLARE @ParamEncrypted varbinary(68), @param varchar(16)

    set @param = 'abc'

    SET @ParamEncrypted = EncryptByKey(Key_GUID('MyKey'), @param)

    select @ParamEncrypted

    SET @ParamEncrypted = EncryptByKey(Key_GUID('MyKey'), @param)

    select @ParamEncrypted

    You get two different values.