473,387 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

prevent SP compilation

Bas
Hi,

I'm using SQL Server 2000 MSDE on a laptop running Windows XP.

I have a couple of SP's that that quite some time to compile. So I was
wondering: is there any way to have the database *not* recompile them every
time after a reboot?

BOL says: "As a database is changed by such actions as adding indexes or
changing data in indexed columns, the original query plans used to access
its tables should be optimized again by recompiling them. This optimization
happens automatically the first time a stored procedure is run after
Microsoft® SQL ServerT 2000 is restarted."

Now the SQL Server is restarted a lot, because laptops don't have endless
batteries <g>

Cheers,

Bas
Jul 20 '05 #1
3 1697

"Bas" <nomailplease> wrote in message
news:3f*********************@dreader4.news.xs4all. nl...
Hi,

I'm using SQL Server 2000 MSDE on a laptop running Windows XP.

I have a couple of SP's that that quite some time to compile. So I was
wondering: is there any way to have the database *not* recompile them every time after a reboot?

BOL says: "As a database is changed by such actions as adding indexes or
changing data in indexed columns, the original query plans used to access
its tables should be optimized again by recompiling them. This optimization happens automatically the first time a stored procedure is run after
Microsoft® SQL ServerT 2000 is restarted."

Now the SQL Server is restarted a lot, because laptops don't have endless
batteries <g>

Cheers,

Bas


I don't believe there's a way around this - in MSSQL 2000, query plans are
only held in memory, not on disk, so there's no way to store the plan. You
could hibernate the laptop, not shut it down - that shouldn't keep the
contents of the memory (although I haven't tried to verify this with MSSQL).

Simon
Jul 20 '05 #2

"Simon Hayes" <sq*@hayes.ch> wrote in message
news:3f**********@news.bluewin.ch...

"Bas" <nomailplease> wrote in message
news:3f*********************@dreader4.news.xs4all. nl...
Hi,

I'm using SQL Server 2000 MSDE on a laptop running Windows XP.

I have a couple of SP's that that quite some time to compile. So I was
wondering: is there any way to have the database *not* recompile them every
time after a reboot?

BOL says: "As a database is changed by such actions as adding indexes or
changing data in indexed columns, the original query plans used to access its tables should be optimized again by recompiling them. This

optimization
happens automatically the first time a stored procedure is run after
Microsoft® SQL ServerT 2000 is restarted."

Now the SQL Server is restarted a lot, because laptops don't have endless batteries <g>

Cheers,

Bas


I don't believe there's a way around this - in MSSQL 2000, query plans are
only held in memory, not on disk, so there's no way to store the plan. You
could hibernate the laptop, not shut it down - that shouldn't keep the
contents of the memory (although I haven't tried to verify this with

MSSQL).
Simon


Sorry, I meant to say that "should keep" the contents of the memory...

Simon
Jul 20 '05 #3
Bas (nomailplease) writes:
I have a couple of SP's that that quite some time to compile. So I was
wondering: is there any way to have the database *not* recompile them
every time after a reboot?


Yes, don't insist on running it after each reboot!

The query plan for a stored procedure is held in memory, as Simon
explain, so the baby goes out with the bathtub.

What you possibly could do, is to declare the procedure as a startup
procedure, so SQL Server executes the procedure when it starts up, so
once you need it, the plan is already there in the cache for you. To
this end, you use sp_procooption.

If the procedure takes parameters, you can write a wrapper procedure
which you declare a startup procedure.

However, if the procedure returns a result set, I am little uncertain
what happens with it. Ah, wait, you wrapper could look like this:
CREATE PROCEDURE wrapper_sp AS

CREATE TABLE #tmp (...)

INSERT #tmp (...)
EXEC your_big_sp

--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Captain Nemo | last post by:
If you look around on the web for advice on cache-control and using 'Option Explicit' you get a paradox. Both features are supposed to be the first piece of ASP code on the page. Well they...
7
by: Philippe Guglielmetti | last post by:
I spent hours chasing a stupid bug of this kind: std::string bad='x'+"yz"; // results in anything except "xyz" ("yz" was in fact returned by some class::operator char*() conversion...) Any...
10
by: Sune | last post by:
Hi, previously I used Eclipse CDT for compiling my files just to get started with C and leave C++ behind. Now it's time to get a little more serious so I've moved my files to a new workplace and...
1
by: Alexander Arlievsky | last post by:
Hi, I have MC++ mixed mode assembly, which also uses MFC. Everything works fine, but C# code, which uses this MC++ assembly sees all MFC symbols as members of the global namespace. When I open...
3
by: Dan | last post by:
Hi, I have a problem using an aspx page with a Control on it. I get the following error message Compiler Error Message: CS1595: 'Test.Class2' is defined in multiple places; using definition...
6
by: thomson | last post by:
Hi all, I have compiled by .net web applicaion in my local machine , and a dll has been created on the bin Directory, And i have copied the entire application using xcopy deployment to a...
3
by: Robert | last post by:
I have a number of web projects converted from 1.1 to 2.0 in VS2005. I am methodically seeing the error below: The element 'compilation' has invalid child element 'compilers'. List of...
6
by: alban | last post by:
Hello I have got some problems of compilation on a AIX IBM, I use the XLC compilator (And I can't install another one). I try to compile code Pro*c ".pc" (oracle), I need do a pre-compilation...
35
by: mwelsh1118 | last post by:
Why doesn't C# allow incremental compilation like Java? Specifically, in Java I can compile single .java files in isolation. The resulting individual .class files can be grouped into .jar files....
6
by: 3mwn8tbfrd19ph0 | last post by:
I am writing codes in windows and Unicode. The windows header file defines CreateFont into CreateFontW. I am using a class which has a function CreateFile. So when compiling, I got error that the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.