Results 1 to 2 of 2

Thread: comparsion two tables

  1. #1
    fluivo Guest

    comparsion two tables

    Hi everbody,

    I have two tables and both tables have same columns.I want find both the tables have same data or not? any body give me t_sql statment.

    Thanks

  2. #2
    Jeff Putnam Guest

    comparsion two tables (reply)

    It's hard to give you tsql without knowing the structure of your tables, and which columns you're trying to compare.. but here's some code to start you off:

    Select table1.column1,table2.column1 from table1
    full outer join table2 on table1.column1 = table2.column1
    where (table2.column1 is null OR table1.column1 is null)

    You can run this for every column to see what's different, but it'll be a big pain in the ass, and also may not tell you anything if your tables are properly normalized. I.E. there may be duplicate issues, different keys with the same data, etc.


    ------------
    fluivo at 6/26/01 10:22:14 AM

    Hi everbody,

    I have two tables and both tables have same columns.I want find both the tables have same data or not? any body give me t_sql statment.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •