I have an encrypted varbinary(MAX) field in my DB called ACCT_FName_encrypt.
I can successfully decrypt this field with:
CONVERT(nvarchar(MAX), DecryptByKey(ACCT_FName_encrypt)) AS 'ACCT_FName_Denc'
But if I try to decrypt the actual value from the column, I get NULL:
CONVERT(nvarchar(MAX), DecryptByKey('0x001D25D87D3D8E49A97863ADC4958E790100000021E26DD2305384AE49EC9329EF2AF8758134F7C946EC9FE024805B8DF21472C4545D461DA9F2B7F96094C2AED09BF4A9')) AS 'ACCT_FName_Denc'
How can I get the decrypted value from the straight varbinary, without calling the field?