Originally Posted by
Shuja Ali
Do you mean to say that you dump the data into a table X when a user requests a report? If that is the case then you will have this kind of problem where data would be stale or not correct for most of the cases when concurrent users use your tool. And this is the not the right way to write a reporting app.
The correct way would be to dump all records into one table and then query from this table. You could use a nightly job to dump all your reporting data into a single table, or you can run the job at regular intervals. If you are using SQL 2005, you could also try looking into partitioning. You could also use a simple view.
I am not sure about your requirement, if this doesn't help you, could you elaborate on what exactly ou are trying to do.