Classic ASP script first run different to subsequent runs

Apologises if the following sounds vague, but I’m stumped as to the reason.

My setup is classic ASP pages connecting to several SQL Server 2008 DBs with the exact same schema but different data in them.

My problem is that when I run my ASP script to create a report of the data in a database (simple queries with a bit of vbscript to add up certain stuff, concat a bit more string info, etc - the script runs and finishes in about 5 secs) the first execution of this script generates completely different data to when I run it a second, third, fourth, etc time and I have no idea why.

If I then run this same script on a different DB it gives me inaccurate data on the first run, but when I refresh the page the data returned is more to what I expect and will continue to do so.

I’ve looked at the code I just can’t understand why the first run would be different to subsequent ones when nothing changes!

Any ideas?

Without seeing the code, not really. It could be any of a number of things…

Hi Dave, thanks for getting back to me. I’ve found it!! I wasn’t putting an ‘order by’ on the query so for some reason the first run was getting a different rowset order than the 2nd, 3rd, 4th, etc runs!! What a nightmare and I had 4077 lines to look through to pin it down!!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.