Free Jobs
Reference


DotNet Questions: ASPNET (128) C#.NET (55) VB.NET (16) AJAX (48) Silver Light (25) WCF (70) WPF (34) WWF (17) .NET 3.5 (29) SQL SERVER (50) Other (9)

Question: give a scenario where RECOMPILE option to the stored procedure is necessary

To get the Posted Questions details daily in your mail Click Here

Share this question on Facebook/Twitter/Orkut Bookmark and Share





User: sonam777 Post Date: 17 Jun 2011 07:37

Introduction:
give a scenario where RECOMPILE option to the stored procedure is necessary



Answer:
When database is changes by adding indexes or changing data in indexed columns, the query plans to access its tables should be optimized again by recompiling them. This happens automatically the first time a stored procedure is run after SQL Server is restarted.



But if a new index is added and it is used by the  stored procedure, optimization does not occur until the next time that the stored procedure is run after SQL Server is restarted. 

so, it can be useful to force the stored procedure to recompile.



About Writer:
Hi Everyone,I am .net Developer From Pune


Writer's Link:

Writer's Email:







Comments:




Post Comment





Similar Questions Top QuestionsLatest Questions Other Questions by this Author







www.freejobsreference.com Copyright © 2009-2011 | All Rights Reserved
All content of this website is protected by copyright laws and should not be reproduced in any form or by any means without written permission
(Best viewed in IE 8.0+ or Firefox 3.0+ at resolution of 1024 * 768 or higher)