Cached Information

  • Hello!!

    I have a SQL Server 7.0 question, and was wondering if any of you had any ideas, etc....

    I have a VB program that executes a select statement against a SQL 7.0 database. My question is regarding cached information. Does SQL Server do this? When this query is run, a user, for example, hits F2 to execute the select - they get no records indicating 0 inventory. So, they make an edit to their inventory, dumping the new record into the table they are querying. However, while the user is still in the VB application, they hit F2 to refresh the query. They still get no records, when in fact - the table they are querying has the new record they should return with the query.

    However, the user can exit completely out of the application, go back in - run the query, and see records. How can I accomplish this same result through the SQL statement, and NOT having the user have to exit/go back into the application?

    This leads me to believe the user is querying a cached set of data, and not the updated table. I can control the select that is embedded in the VB program - Is this what I would need to do? And if so, how would I do that? If not, what might be a good place to start?

  • If there is caching, it is your app doing something funky within iteself or in ADO.

    I've written a number of apps and this does not happen. When SQL Server caches data, it also updates the cache with changes or it requeries the data. If you run this from a simple ADO based web page, you will see it happening.

    Steve Jones

    steve@dkranch.net

  • One other thing you can do is turn on Profiler and see if the application sends a new query to SQL Server when F2 is pressed. That'll let you know if it's even going back to the database.

    K. Brian Kelley

    bkelley@sqlservercentral.com

    http://www.sqlservercentral.com/columnists/bkelley/

    K. Brian Kelley
    @kbriankelley

  • Maybe you could post the code that is doing the initial select and the refresh?

    Andy

  • Sounds to me like you did not actually refresh the recordset. What exactly does F2 fire as far as code would be where I check. Make sure it either requires the recordset or frees the recordset and rebuilds.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply