CREATE procedure [dbo].[sp_who_lock] as begin declare @spid int,@bl int, @intTransactionCountOnEntry int, @intRowcount int, @intCountProperties int, @intCounter int ,),spid smallint,bl smallint) RETURN @@ERROR ,blocked ) a ) b where a.blocked=spid) R…