How to view data differently?

  • Hi,

    I need to compare the data from the same tables and same databases but in two different environments (Development vs Production). The SQL reuslts indicate that the data from some columns are different between the two environments. But when I looked at the data manually, they looked the same to me. Is there any editer available (like old software SPFPC?) which allow us to view the data in a different format and may show the differences visually??

    Thanks for any help!

    ypt

  • You could export to a text file and use UltraEdit32 to compare the two.  I prefer

    SELECT * FROM dbo.table t1 FULL OUTER JOIN server.db.dbo.table t2 WHERE t1.col1<> t2.col2 OR t1.col1  <> t2.col2

    etc, etc, etc.  This will show only the rows that are different on either side.  If you want to get specific, you can have a CASE statement in your select to show a blank for rows that are the same, or show a concatenated string of both if different.  It's a question of how fancy you want to get with this.

    Derrick Leggett
    Mean Old DBA
    When life gives you a lemon, fire the DBA.

  • Hi Derrick,

    Thank you very much for your reply. I downloaded the trial version of UltraEdit32 for comparing the data.

    One question: should we compare null values???

    One thing I noticed is that some of the columns had null values in them. The results of comparing null values from the same table columns between two environments (DEV vs Production) indicated that the values are different. I have a silly question here: should we compare null values???  I guess that we really shouldn't because it doesn't make sence. But I would like to post this question to get some opnions or confirmation on this.

    Any response from anyone will be really appreciated. Thanks.

    ypt

     

  • From SQL BOL (index value "joins-SQL Server, null values")

    Null Values and Joins

    When there are null values in the columns of the tables being joined, the null values do not match each other. The presence of null values in a column from one of the tables being joined can be returned only by using an outer join (unless the WHERE clause excludes null values).

  • Hi Culpepmw,

    Thanks for your response. I undertand now.

    Have a nice day.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply