Link to home
Start Free TrialLog in
Avatar of Niall Gallagher
Niall GallagherFlag for Ireland

asked on

ENCRYPTED FIELD NOT SHOWING UP IN SEARCH

I have a table with a few encrypted fields using a Encryption function. This has worked for years (since 2006) but today I did a search using the encrypt function

eg select * from table1 where encrypted_field = dbo.data_encrypt('1111111111111111')
but it brings back no results but if I do
select dbo.data_encrypt('1111111111111111')
which returns XYXRE!dr257itcsWEE
and then search
select * from table1 where encrypted_field = XYXRE!dr257itcsWEE
it brings back over 400 records.
We have recently changed from SQL2005 to SQL 2008. other than that I can't think of anything else. It also seems that the records are all from before we did the changeover
Avatar of arnold
arnold
Flag of United States of America image

What is the data type for the column?
Try using cast to enclosed the encrypt function to make sure that the data types match.
ASKER CERTIFIED SOLUTION
Avatar of Niall Gallagher
Niall Gallagher
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Niall Gallagher

ASKER

We found the solution after playing with the function.