SQL Server 2017 CU2 Bug with msdb Compatibility Mode

This will be a very short blog post to make you aware of a bug in CU2 for all of those who I know have eagerly installed the newest CU for 2017.  A small bug I have found is that it changes your compatibility mode on the msdb database to 130.  All our servers were set to 140 and our nice server policy check alerts fired off and sent me 58 pages the day after I installed it in my development environment.  Well, I double checked before installing on QA today and sure enough, it changed it from 140 to 130.  So have your code ready to change it back after you install.

UPDATE 1/5/2018: CU3 contains the same bug.  Microsoft confirmed this was a bug in CU1 as well.

If you need some code to change your compatibility mode here you go, be warned it does all databases not just msdb:

DECLARE @SQLCmd NVARCHAR(MAX) = '';
SELECT @SQLCmd += REPLACE(
'
ALTER DATABASE {{DBName}} SET COMPATIBILITY_LEVEL = 140;
'
, '{{DBName}}', name)
FROM sys.databases;
EXEC (@SQLCmd);

Related Posts

2 thoughts on “SQL Server 2017 CU2 Bug with msdb Compatibility Mode

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.