Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3324220
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:23:45+00:00 2026-05-17T23:23:45+00:00

Stored procedures are compiled on first use. There are options to clear cache: DBCC

  • 0

Stored procedures are compiled on first use.

There are options to clear cache:

DBCC FREEPROCCACHE
DBCC DROPCLEANBUFFERS
--To Verify whether the cache is emptied
--DBCC PROCCACHE

or to recompile or to reduce recompilations.

But is it possible to force frequently used stored procedures’ execution plans be pre-cached and stay in memory?

I know how to do it in ADO.NET, i.e. from outside of SQL Server, but this question is how to do inside SQL Server – to be launched with the start of SQL Server itself.

(*) For example, I see in SSMS Activity Monitor a running process (Task State: RUNNING, Command: SELECT) that is continuously executing T-SQL (according to Profiler) in context of tempdb database though SQL Server Agent is disabled and SQL Server is not loaded by anything, see “Details of session 54” in “Where are all those SQL Server sessions from?“.

How would I do the similar resident process (or, rather, auto-starting by SQL Server start service or session) periodically recycling stored procedure?

Related question:
Stored procedure executes slowly on first run

Update:
Might be I should have forked this question in 2 but my main curiosity is how to have periodic/ looping activity with SQL Server Agent disabled?
How was it made with mentioned above RUNNING SELECT session (*)?

Update2:
Frequently I observe considerable delays while executing stored procedures querying very small amount of data which cannot be explained only through necessity to read huge amounts of data.

Can we consider this – considerable delays on insignificantly small data – as context of this question?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:23:45+00:00Added an answer on May 17, 2026 at 11:23 pm

    Seems like this question eventually got answered in:

    • Can I get SQL Server to call a stored proc every n seconds?

    Update: These tips will do the trick:

    • Keeping data available in the SQL Server data cache with PINTABLE
    • Automatically Running Stored Procedures at SQL Server Startup
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As far as I know, in MS SQL Server 2000+ stored procedures are compiled,
How can I get compiled Mysql stored procedures from their physical location?
When we create stored procedures in Visual Studio (with the extension .sql) the file
Conventional wisdom states that stored procedures are always faster. So, since they're always faster,
Converting a couple stored procedures from MySQL to Microsoft SQL server. Everything is going
I have some complex stored procedures that may return many thousands of rows, and
We're using Stored Procedures for every query to the DB. This seems incredibly un-
I'm executing stored procedures using SET FMTONLY ON, in order to emulate what our
I have stored procedures in SQL Server T-SQL that are called from .NET within
A number of stored procedures I support query remote databases over a WAN. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.