1

The project I work on uses the process of database first, update EF model from db afterwards.

I face the following problem: if the database is in "compatibility level SQL Server 2016", my update of the model from database never returns (takes hours).

I have to restart Visual Studio.

When I update the database properties to "compatibility level SQL Server 2012", my update of the model from database takes 10s.

This workaround is my MO for now.

BUT.. what do I have to change to avoid that extra step (change compatibility level) after publishing my db?

Versions used:

Microsoft SQL Server 2016 (SP1) (KB3182545) - 13.0.4001.0 (X64)   
Oct 28 2016 18:17:30   
Copyright (c) Microsoft Corporation  
Developer Edition (64-bit) on Windows 10 Enterprise 6.3 <X64> (Build 15063: ) (Hypervisor)

Microsoft Visual Studio Enterprise 2017 - Version 15.4.2
VisualStudio.15.Release/15.4.2+27004.2006

Microsoft .NET Framework, Version 4.7.02046
  • Microsoft MI-Based Debugger 1.0
  • Microsoft Visual Studio VC Package 1.0
  • NuGet Package Manager 4.4.0
  • SQL Server Data Tools 15.1.61707.200
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

2

Change the database compatibility back to 2012 before updating the model.

In SQL Management Studio, right-click on Database.

Properties-> Options -> Compatibility Level -> SQL Server 2012 (110)

Hamid
  • 1,493
  • 2
  • 18
  • 32