I have been searching for 2 days for the solution to this, but every solution does not apply to my situation.
I have 2 SQL servers: DataServer and InterfaceServer set up as linked servers. DataServer does all of our data processing. InterfaceServer pulls only the data it needs from DataServer. Each server has its own encryption process and our compliance department does not want them to use the same passwords/certficates/etc... Due to these restrictions, I am unable to execute a stored procedure that does the decryption for me.
I have tried creating views with the DecrypByKeyAutoCert() function as well as creating views with SELECT ... FROM OPENQUERY() to execute the stored procedure that does the decryption, but they always return NULL values for the decrypted data. If I run them on the DataServer itself, it returns the data fine.
Is there a way to create an assymmetric key on InterfaceServer, use the public key to encrypt data in a table on DataServer, then decrypt it on the InterfaceServer after copying everything over?