I provide the complete set of scenario for this test environment, it can be depends upon you to change the scenario according to you.
Extract or build the DLL file xp_md5.dll and place it in
C:\Program Files\Microsoft SQL Server\MSSQL\Binn(or wherever appropriate).
A precompiled DLL is in the Release directory of the source distribution.
Create an Extended Stored Procedure called xp_md5 in the "master" database.
Right-click "Extended Stored Procedures" under the master database in the Server Manager and click "New Extended Stored Procedure...". Enter xp_md5 for the "Name" and for the "Path", enter the full path to xp_md5.dll.
Adding extended stored procedure.
EXEC sp_addextendedproc 'xp_md5', 'xp_md5.dll'
Create an User define Function
CREATE FUNCTION [dbo].[fn_md5x] (@data IMAGE, @len INT = -1)
RETURNS CHAR(32) AS
DECLARE @hash CHAR(32)
EXEC master.dbo.xp_md5 @data, @len, @hash OUTPUT
Compare old and new Image
WHERE dbo.fn_md5x(oldimage, datalength(oldimage))
I think the article is quite informative and thanking for giving time on it.
Posted by: MR. JOYDEEP DAS