Compare results from different database

I have a stored procedure that I execute on different databases to present results. What's the easiest way to compare these results ?

more ▼

asked Jun 23, 2012 at 06:15 AM in Default

avatar image

30 1 1 3

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

Funnily enough, I had the same requirement recently. I blogged my approach here: http://thelonedba.wordpress.com/2012/06/21/warning-wordbreaker-filter-or-protocol-handler-used-by-catalog-foo-does-not-exist/

The gist of the process is:

  1. Create temporary table (or two) to match the output of your stored procedure

  2. execute the stored procedure into the temporary table. This was complicated for me by it being on a separate server...

  3. Repeat, running the SP from the second server/database.

  4. Do your comparison.

It's all relatively straightforward, just a bit long-winded. I'm sure I could have written the code better, for example!

This technique only works if there is one recordset output by your SP.

Things you'll need to know about:

Hope this helps.

more ▼

answered Jun 23, 2012 at 12:08 PM

avatar image

ThomasRushton ♦♦
42.3k 20 57 53

Yep, that worked beautifully and was quite simple. Thaks so much Thomas!

Jun 24, 2012 at 05:44 PM davehd
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Jun 23, 2012 at 06:15 AM

Seen: 578 times

Last Updated: Jun 25, 2012 at 11:10 AM

Copyright 2018 Redgate Software. Privacy Policy