cancel
Showing results for 
Search instead for 
Did you mean: 

Compare 2 SAP tables Contents having same number of Fields

jaiswal_g1
Explorer
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

jong-un_seo
Participant
0 Kudos

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/aad2d7bfbc2b1014babaa254...

Best regards,

Jongun