Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

caching a resultset

Status
Not open for further replies.

habneh

Programmer
Mar 21, 2007
55
US
Here is my question, please tell me whether we can do it or not.
can we cache a resultset of a query for later use, like we cache an execution plan of a query to be reused later.
The reason I am asking is
I want to catch a resukt of a query and reuse it later unless the result set is changed.

please comment on this

thanks
 
You can not cache the result set they way you want to within SQL Server. However, keep in mind that SQL Server has a data cache. When you run a query you data is saved in the data cache and depending on how much memory is in your system, (how long data stays in memory before it is paged out)
you just have to re-run your query and you will get the data faster than the first time you ran the query. You query plan is also cached in the procedure cache. If you want to keep your result set in cache you should do it on the application side.

- Paul
10qkyfp.gif

- If at first you don't succeed, find out if the loser gets anything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top