SQL Server compare results of two queries that should be identical

前端 未结 6 2013
面向向阳花
面向向阳花 2020-12-24 11:14

I am modifying a sql server 2005 stored procedure slightly for performance, and I would like to quickly make sure the old stored proc and the new one return the exact same r

6条回答
  •  星月不相逢
    2020-12-24 11:28

    create table #OldProcResults (
        
    )
    
    create table #NewProcResults (
        
    )
    
    insert into #OldProcResults
        exec MyOldProc
    
    insert into #NewProcResults
        exec MyNewProc
    

    then use Jabs' answer to compare the two tables.

提交回复
热议问题