Sample Header Ad - 728x90

Should I use the deprecated MD5 function in SQL Server?

4 votes
1 answer
3252 views
We'd like to use **MD5** for our hashing function, instead of **SHA_256**, but as of SQL Server 2016, MD5 is deprecated. We're using this for hashing (comparing which records have changed). We now have this dilemma of using of risking it by using this function, or incurring storage and performance overhead of using SHA_256. It's frustrating Microsoft decided to deprecate these functions even though they are still useful in certain scenarios. This project isn't a critical component of the business. We'll likely go with SHA_256, but is this the right choice? Should new development always avoid deprecated functions? For context - daily will be about 1-2 million rows, upserting into a 400 million row table, comparing hashbytes on the fly. About 30 columns wide. https://learn.microsoft.com/en-us/sql/t-sql/functions/hashbytes-transact-sql?view=sql-server-2017 https://dba.stackexchange.com/questions/35219/choosing-the-right-algorithm-in-hashbytes-function
Asked by Gabe (1396 rep)
Feb 7, 2019, 02:38 PM
Last activity: Jul 19, 2025, 05:50 AM