SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 varchar vs varbinary for storing encrypted informa
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

iasonas
Starting Member

2 Posts

Posted - 03/12/2013 :  13:04:19  Show Profile  Reply with Quote
Hello,

I have been looking for pros and cons in storing encrypted information in varchar and varbinary datatypes.
From what I understand, varbinary may have an advantage with the amount of storage it requires to store the same information.
Are there any other differences between the two datatypes that would make one preferable over the other for storing encrypted information?

Thanks,
Jason

robvolk
Most Valuable Yak

USA
15676 Posts

Posted - 03/12/2013 :  13:22:19  Show Profile  Visit robvolk's Homepage  Reply with Quote
Binary is probably easier, SQL Server's built-in encryption features return results as binary. Varchar may offer more options for searching, but typically you don't (or shouldn't) search encrypted data anyway.
Go to Top of Page

iasonas
Starting Member

2 Posts

Posted - 03/12/2013 :  13:32:33  Show Profile  Reply with Quote
Hi robvolk,

I am encrypting the information before it reaches the database. Does that take away the easier part or are there other reasons apart from the built-in features that would make you say binary is easier?
I would of thought that because varchar is human readable it would be the one that is easier to work with.

Thanks
Go to Top of Page

robvolk
Most Valuable Yak

USA
15676 Posts

Posted - 03/12/2013 :  13:36:24  Show Profile  Visit robvolk's Homepage  Reply with Quote
It doesn't really matter, if you're already encrypting it before it gets to the database. Frankly, you don't want encrypted data to be readable, and vice versa.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.2 seconds. Powered By: Snitz Forums 2000