Solved

Why does this keep coming up NULL?

Posted on 2016-08-24
2
55 Views
Last Modified: 2016-08-24
Here's my SELECT:

select Patient.AccountID, Patient.PracticePatientID as PracticeAccountID,
    RIGHT('    ' + CONVERT(varchar(100), DecryptByKey(Patient.hSSN)) ,4) as SSN,
    Patient.PatientDOB, Patient.PatientID
    from Patient (nolock)

Open in new window


Here are the results I get:

results
You'll notice that everything under SSN is NULL.

Thing is, I've got data in those fields, as you can see here:

SSNs
Why do I get a NULL value for every attempt to decrypt the values in the hSSN field?
0
Comment
Question by:brucegust
2 Comments
 
LVL 35

Accepted Solution

by:
YZlat earned 500 total points
ID: 41768876
DecryptByKey must be returning null or empty string
0
 

Author Comment

by:brucegust
ID: 41768925
And my DBA counterpart just confirmed that. The good news is that I found a different resource that gives me what I'm needing, so I'm gold!

Rock on!
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question