473,788 Members | 2,854 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1714

"Bas" <nomailplease > wrote in message
news:3f******** *************@d reader4.news.xs 4all.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******** *************@d reader4.news.xs 4all.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
1469
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 can't BOTH be first can they? OK - I give up. How do you do it?
7
1806
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 idea on how to prevent this to compile ? I tried to define an operator+(const char lhs, const char* rhs) that would fail, but my compiler (VC 7.1) says one of the operands must be a class... -- Philippe Guglielmetti - www.dynabits.com
10
2362
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 begun to use GNU Autotools. I'm sorry to say I'm new to gcc as well :( Now I get the most ridiculous compile error which I'm unable to solve. Can someone, please, help me with this? gcc output together with the files mentioned in the gcc error...
1
1386
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 MC++ assembly I actually see all metadata of those classes. Obviously, in most cases classes have no members, but I see class names like CArchive etc. I didn't get this behaviour on VS.NET 2002. I tried to play with compiling MFC as unmanaged, or in...
3
3352
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 from 'c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\1f575646\ad3a161b\assembly\dl2\57ca505e\044565c0_f84fc401\Test1.DLL' The problem is that the control is defined in two different assemblies
6
1536
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 different server. i have copied only the aspx file , the dll file as well as the config files.
3
8710
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 possible elements expected: 'assemblies, buildProviders, codeSubDirectories, expressionBuilders'. Here's what the web config looks like. The error doesn't cause any issues and according to the MSDN documentation this is valid. So why is VS2005
6
9803
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 after the pre-compilation with the my makefile I get the files ".c" After this a get also the objects files ".o", but no linkage ! and I can't have the exec file ! I have got some errors how I dont understand really :
35
3056
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. In C#, there appears to be no analog. I have to compile all my .cs files into a single .dll. This has serious drawbacks in terms of compilation. With Eclipse, I change a file and only that file is re-compiled. With Visual Studio, I
6
2286
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 CreateFontW is not a member of the class. What should I do? Thanks for your help!
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10364
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10172
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9967
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.