C# App to compare 2 SQL Server Stored Procedure Outputs
C# App to compare 2 SQL Server Stored Procedure Outputs Ever had to compare the output result sets of 2 stored procedures in SQL Server? Well, today I had to find a solution because one of the teams I work with is changing code for performance improvement and needs to compare result sets between the old and new version to ensure the results did not change. The trouble is - the solution has to handle procedures returning 1, 2, 3, ... n result sets. This makes it more complicated as you cannot insert the output of the procedure into a table or temp table and compare using FULL JOINS. Here is an example Procedure 1 CREATE OR ALTER PROCEDURE [dbo] . [sp_MultipleResultsets_1] ( @int_Param1 int , @int_Param2 int ) AS BEGIN -- Set 1 SELECT TOP 100 OrderId , UserId , OrderTime , ProductCount , TotalPriceUSD , DiscountCode FROM dbo . MSTVF_Orders ORDER BY OrderId -- Set 2 SELECT TOP 100000 OrderId , UserId , OrderTime , P...