I have a table with three columns:
user varchar, status varchar , rep int
status and rep get updated often and one of the requirements is:
Given a datetime value view status and rep values, for each user, at the given date.
I can add an updated_at datetime column to the table and insert new rows whith the same user instead of update existing ones, but the table gets large and I need to join the query results to similar results from other tables, thus I need a fast query.
What is the best performing solution to this problem in SQL Server?
Depending on exactly how you are going to use the reporting information, it might be best to create a History table that before you update the main table, you write the current values off to the History table, adding the timestamp.
That would be best if you are really only picking out specific days/users/statuses from the history