user1788742
user1788742

Reputation:

EF update model from SQL Server 2016 database takes too long

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

Upvotes: 1

Views: 641

Answers (1)

Hamid
Hamid

Reputation: 1563

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)

Upvotes: 2

Related Questions