Keep your Compiler level set to 3

This is just a helper I used over the years to reset my compiler level from 4 back to 3; I believe it's still going to help some of you with those long waiting minutes when compiling a project that has a significant number of objects, when the TFS policy changes the Compiler level automatically to 4.
I do this and then run Check BP from the Add-ins menu when I choose.



Run this in any SSMS query window on your development data database:

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TRIGGER [dbo].[ResetCompileLevelTo3]
   ON  [dbo].[USERINFO]
   AFTER UPDATE
AS
BEGIN
    SET NOCOUNT ON;

    UPDATE [dbo].[USERINFO]
    SET COMPILERWARNINGLEVEL = 3
    WHERE [ID] = (SELECT [ID] FROM inserted) AND
          COMPILERWARNINGLEVEL = 4
          -- AND [ID] = 'your.id'

END
GO

ALTER TABLE [dbo].[USERINFO] ENABLE TRIGGER [ResetCompileLevelTo3]
GO

No comments:

Post a Comment