I am using SQL Server 2008/2012.In my database I have a table which has encrypted column.
I am getting encryption key of a encrypted column by using this query -
SELECT DISTINCT key_name(encryptedcol) FROM encryptedTable;
my encrypted column name is encryptedcol.
Now I want to get the certificate name which is used to create the encrypted key (means I need the certificate name which is used to open the above symmetric key to decrypt data).
For example -
Here highlighted text is my certificate name , which is here hardcoded but I want to get this from a sql query.