I'm using AES_256 algorithm
SELECT count(1)
from [dbo].[EmployeeMaster]
where [UserName]=EncryptByKey (Key_GUID('Symmetrickey'),'Username')
Here a value with matched case, but result is '0'
with this code i'll get result. but i have huge amount of data for comparing this
SELECT count(1)
from [dbo].[EmployeeMaster]
where CONVERT(nvarchar, DecryptByKey([UserName]))='Username'
Can anyone suggest me a better way?