Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 SET causing recompiles?

Author  Topic 

ferrethouse
Constraint Violating Yak Guru

352 Posts

Posted - 2012-06-25 : 19:06:21
Almost all of my stored procs contain this...


SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO


But I got a warning from some monitoring software I recently installed (Quest Foglight) that states that inclusion of these "SET" statements can cause recompiles.

This confirms it...

http://msdn.microsoft.com/en-us/library/ee343986%28v=sql.100%29.aspx

Comments?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-06-25 : 20:31:02
That's correct, so if you want to avoid it, have your connection use those SET options.

You can check if it recompiled via set statistics time on.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -