2

We are trying to compare stored procedure codes. Example, these two stored procedure codes produce same result.

(1) Is there method to convert stored procedures into binaries to validate they conduct the same thing?

(2) How would i tell if stored procedures are the same (minus comments, line spaces, and extra text)?

Context: we just created an auto code generator for project (Slowly changing dimensions). Comparing new code generator with older archive code.

create procedure dbo.NumberSum
as
select 2 + 2 as SumDigits


create procedure dbo.NumberSum
as
-- Extra line comment
select 2 + 2 as SumDigits
  • 2
    Consider using the SQL Server Data Tools (SSDT) schema compare feature (included with Visual Studio). This has options to ignore comments and whitespace. – Dan Guzman Mar 25 at 2:18
  • 1
    Just to note, 2 procedures that are not the same might return the same result set. To actually conclude that their logic is the same requires a very complex analysis. – EzLo Mar 26 at 7:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy