Home Forums SQL Server 2008 T-SQL (SS2K8) help with query - am I going down the right path on this RE: help with query - am I going down the right path on this

  • SQL_NuB (3/20/2013)


    the values that are different so for example

    if Active is true in DB2 and now coming in as FALSE in DB1, I need that.

    as for NULL values, I never thought, how can I handle those?

    Single fixed query can only select the same fixed number of columns.

    As you select all columns from both ends, so you will get all values.

    Nulls can be values by different ways. Most robust and neat one would be:

    WHERE NULLIF(t1.Col1,t2.Col1) IS NOT NULL OR NULLIF(t2.Col1,t1.Col1) IS NOT NULL

    OR NULLIF(t1.Col2,t2.Col2) IS NOT NULL OR NULLIF(t2.Col2,t1.Col2) IS NOT NULL

    OR ...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]