Here I show you 2 easy ways to change the DB compatibility level in powershell. Otherwise you have to use a T-SQL cursor and that’s not only much harder, it’s just no fun. Trust me… use powershell for stuff like this and you’ll be much happier.
Change DB Compatibility Level in Powershell
