Wrox Programmer Forums
|
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 8th, 2009, 09:39 AM
Authorized User
 
Join Date: Nov 2005
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to joxa83 Send a message via Yahoo to joxa83
Default Statement Level Recompile

I've read that SQL Server 2005 supports statement-level recompile. Instead of having all queries in the stored procedure recompiled, SQL Server can now recompile individual statements.
When I create following procedure
SET NOCOUNT ON;
USE Northwind;
IF OBJECT_ID('dbo.useKeepPlan', 'P') IS NOT NULL
DROP PROC dbo.useKeepPlan;
GO
create procedure useKeepPlan as
create table #t (a int, b char(3))

-- Make greater than 6 changes to #t
insert #t values (1, 'abc')
insert #t values (2, 'abc')
insert #t values (3, 'abc')
insert #t values (4, 'abc')
insert #t values (5, 'abc')
insert #t values (6, 'abc')
insert #t values (7, 'abc')
-- Now reference #t
select count(*) from #t
go

and run it for first time I get
SP:Recompile
SQL:StmtRecomplie events
when select count(*) from #t statement is reached.
Should there only be SQL:StmtRecomplie event withouth entire procedure recompilation?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Codebehind Recompile problem... Nostromo77 ASP.NET 2.0 Basics 9 December 22nd, 2008 09:33 AM
Modify resource file with out recompile the proj ndc550 ASP.NET 2.0 Basics 0 November 2nd, 2006 05:19 PM
LOG-IN and LEVEL cli PHP How-To 2 May 29th, 2005 04:30 PM
access level taoufik Beginning PHP 8 November 15th, 2004 04:29 AM
Protection level noman77 .NET Framework 2.0 0 October 23rd, 2004 07:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.