Was spending a bit of time staring at Activity Monitor and noticed that “return sys.fn_varbintohexsubstring(1,@pbinin,1,0)” was one of the queries mentioned.
What is sys.fn_varbintohexsubstring(1,@pbinin,1,0)?
Well it converts binary data to string.
We are using cell level encryption and as so our data is saved as binaries. To decrypt the data we issue DecryptByKey and convert/cast the returned data to our original data type.
cast(DecryptByKey(address) as varchar(255))
- Itzik Ben-Gan – SQL Server 2008’s T-SQL Features – Small new features provide big benefits
Feb 17, 2009
SQL Server 2008 – Features
- Raul Garcia – Recommendations for using Cell Level Encryption in Azure SQL Database
May 12th, 2015