Skip to Content

Compare 2 SAP tables Contents having same number of Fields

Is there any SAP utility given to compare 2 table Data Contents ? Both are having identical structures .

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 04, 2018 at 01:05 AM

    Hi Gopal,

    I think you can use hashbytes() to compare contents of the two tables.

    For example,

    select hashbytes('sha1', col1, col2,...) as hashval into #tab1 from tab1
    go

    select hashbytes('sha1', col1, col2,...) as hashval into #tab2 from tab2
    go

    select count(*) from #tab1 a, #tab2 b where a.hashval = b.hashval
    go

    If you want to know hashbytes() in detail, please refer to the manual.

    https://help.sap.com/viewer/2df920cd5b1644e5a065d55b637d5e92/16.0.3.5/en-US/aad2d7bfbc2b1014babaa254e16414ec.html

    Best regards,

    Jongun

    Add comment
    10|10000 characters needed characters exceeded