1
Bikonja
6y

Why SQL, why???
I have a proc I need to modify so I add a select into it. Drop the proc and recreate it, run it, new select not giving results.
Modify the select to inverse filter to see what I do have, recreate the proc, run it, still no results...
Run four different cache cleaning queries, still no results from the new select...
Add a "select 1" before the new select, recreate and run the proc and now I have the new 1 and also the other select now has results...
Change the filters back, still getting same results...
Remove the select 1, no results...
What kind of devil cache is this?

Comments
  • 1
    Maybe smth like
    CHECKPOINT;
    GO
    DBCC DROPCLEANBUFFERS;
    GO
    ?
    (Sorry, assumed mssql)
  • 1
    @olezhka tried that (although didn't try setting the checkpoint tbh, but tried various commands, including dropcleanbuffers... Nope, none of them clear the cache properly...
    And yeah, mssql is in the tag so you assumed correctly :)
  • 2
    @Bikonja ah ok, must have read the tag and forgot about that while typed the response :D #imagoldfish #findingdory
  • 1
    @olezhka I *really* know what that's like :D
  • 0
    Not the cause, but I noticed that there was a massive select (doesn't even fully fit on one screen) in an else block, only it didn't have a begin and end around it so that was causing some issues, but even after encapsulating in begin and end the cacheing issue still remains...
Add Comment