0
(0)

declare @CompatibilityLevelUpdate varchar(255)
set @CompatibilityLevelUpdate = "
select @CompatibilityLevelUpdate =@CompatibilityLevelUpdate +
'alter database [' + name + '] set compatibility_level =150;' + char(15)
from sys.databases
where database_id>4 — exluding system databases
exec (@CompatibilityLevelUpdate)

Verify compatibility level

select name as DatabaseName, compatibility_level as Compatibility
from sys.databases
where database_id > 4 — exluding system databases
order by name

Sample Output:

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.