Since you said in T-SQL I won't bother trying a PoSH solution. The way I'd typically do something like that is to use a linked server from DEV to Prod (or vice-versa), dump the results of the 2 procs into temp tables, and do an EXCEPT. Something like this:
INSERT INTO #prod
EXEC linkedservername.databasename.schemaname.procname;
INSERT INTO #dev
EXEC schemaname.procname;
/* this returns all the rows in prod not in dev
SELECT *
FROM #prod
EXCEPT
SELECT *
FROM #dev AS d;
You could also reverse the order of the queries in the EXCEPT to find out if there are rows in Dev not in Prod.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question