i want to decrypt a text, while i am using a viewselect CONVERT(nvarchar, DecryptByKey(EncryptedNationalIDNumber)) from myView where id=1
like here : [url]http://msdn.microsoft.com/en-us/library/ms181860(SQL.90).aspx[/url]when i want to decrypt, i first must open the SYMMETRIC KEY, for example :OPEN SYMMETRIC KEY SSN_Key_01 DECRYPTION BY CERTIFICATE HumanResources037;GOSELECT NationalIDNumber, EncryptedNationalIDNumber AS 'Encrypted ID Number', CONVERT(nvarchar, DecryptByKey(EncryptedNationalIDNumber)) AS 'Decrypted ID Number' FROM HumanResources.Employee;GO
beacuse of unabling to do that, i thought to use a scalared-function,but there it dosen't let me to use the "OPEN SYMMETRIC KEY"any idea what else can i do?ThanksPeleg