This is depends upon which automation tool u are using.
Suppose let us take WinRunner
in WinRunner we have the check point in Database checkpoint in that u have the Runtime record check
using that we can compare the Runtime record is there in database or not