I need to read the last timestamp value (MAX(TimeStampValue)) from a table, store it in a separate table (TableMaxTimeStamp) and perform a comparison against another table and load delta records.
I'm having a real hard time doing the above.
The varchar data type is not playing well with the timestamp data type. Reading from a timestamp into a varchar works. Reading from a varchar and trying to compare with a timestamp doesn't work.
What's the best way to store a timestamp value for a comparison?