I created a new column named AddressEncrypted and it works forme using EncryptByKey/DecryptByKey.
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'MyTest!Mast3rP4ss';
--verify by open/close.
OPEN MASTER KEY DECRYPTION BY PASSWORD = 'MyTest!Mast3rP4ss';
--CLOSE MASTER KEY;
CREATE CERTIFICATE Sales09
WITH SUBJECT = 'Addresses';
GO
CREATE SYMMETRIC KEY Addresses_Key11
WITH ALGORITHM = AES_256
ENCRYPTION BY CERTIFICATE Sales09;
GO
-- Create a column in which to store the encrypted data.
ALTER TABLE SalesLT.Address
ADD Address_Encrypted varbinary(160);
GO
-- Open the symmetric key with which to encrypt the data.
OPEN SYMMETRIC KEY Addresses_Key11
DECRYPTION BY CERTIFICATE Sales09;
-- Encrypt the value in column Address using the
-- symmetric key Addresses_Key11.
-- Save the result in column Address_Encrypted.
UPDATE SalesLT.Address
SET Address_Encrypted = EncryptByKey(Key_GUID('Addresses_Key11')
, AddressLine1, 1, HASHBYTES('SHA2_256', CONVERT( varbinary
, AddressID)));
GO
-- Verify the encryption.
-- First, open the symmetric key with which to decrypt the data.
OPEN SYMMETRIC KEY Addresses_Key11
DECRYPTION BY CERTIFICATE Sales09;
GO
-- Now list the original card number, the encrypted card number,
-- and the decrypted ciphertext. If the decryption worked,
-- the original number will match the decrypted number.
SELECT AddressLine1, Address_Encrypted
AS 'Encrypted address', CONVERT(nvarchar,
DecryptByKey(Address_Encrypted, 1 ,
HASHBYTES('SHA2_256', CONVERT(varbinary, AddressID))))
AS 'Decrypted address' FROM SalesLT.Address;
GO
The results is: