I think I have a basic question here that many might have encountered. When I run a query in SQL Server it will load in memory all the data it needs for query execution (for
SQL is a high level declarative language. It is not intended to allow you to get involved in the detail of such things as memory management as you would if you were writing code in a lower level Programming language such as C. I think you will find that if it needs that memory freed up for another task it will quickly let it go.