In SQL Server would a varbinary(16) be the most efficient way of storing an MD5 hash? Won’t be doing anything with it except returning it in a linq query.
In SQL Server would a varbinary(16) be the most efficient way of storing an
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Based on the documentation on MSDN and my experience, binary is better, since the md5 hash does not vary in size.
The size for a binary data type is n bytes, so the size of the data. The size of a varbinary data type is n bytes + 2 bytes on top of the size of the data.