Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Encrypting an empty String

Status
Not open for further replies.

new2thegame

Programmer
Aug 20, 2010
2
US
Could someone please tell me how to encrypt and empty string in the below code:

CASE
WHEN field = 'USA' THEN EncryptByKey(Key_GUID('Supplimental_01'),'') end

The original statemen would be:

CASE
WHEN field = 'USA' THEN '' END

I need the result to encrypt the '' and with the way I have it written, it returns 'NULL'

Any help would be greatly appreciated!!

Thanks!!
 
Code:
CASE
WHEN field = 'USA' THEN ' ' END

?


Borislav Borissov
VFP9 SP2, SQL Server 2000,2005 & 2008.
 
I need the result to be encrypted, not just empty value? I know that much :0)...
 
There's nothing to encrypt... an encrypted empty string = an empty string. Nothing to do the math on.

I had a project recently where I had to decrypt something that was encrypted by another program. I ended up having to write my own CLR function.

I'm not sure that encryption is something built in to SQL server....



Just my 2¢

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top