Search code examples
sql-serverdatabaseevent-logerror-log

SQL Server error log on changing database compatibility level


We are trying to capture changes to SQL Server database status, such as changes to database compatibility. I'm seeing that in SQL Server 2008 R2, the Event ID 5084 is logged in Windows application log when there is a change to database compatibility. In SQL Server error log, I can also see this message "Setting database option COMPATIBILITY_LEVEL to XX for database XXX"

But this is not happening in SQL Server 2019! I've tried different servers with same results. If I run this query

select *
from sys.messages
where message_id = 5084
and language_id = 1033

then I can see the is_event_logged column = 1

I can't figure out why changes to database options are not logged in SQL Server error log and Windows Application log. Is there a trace flag I need to enable?

Can anyone help? Thanks.


Solution

  • OK I think I've found the reason for this - it doesn't work in Developer Editions, I tried in Enterprise Edition and it worked as expected. I assume it would work with Standard Edition as well but haven't tested it yet.