可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
Using a new SQL2005 database project in VS2010.
I did import objects and settings, and built the project.
It seems to be stuck at 'Analyzing database schema. Your database projects will be ready after 3267 operations are completed'.
This seems to take hours.
Is there any way to speed this up?
I read somewhere that this may happen if my .dbmdl file is too big, but it's just 2.6MB.
回答1:
- Go to Project Settings
- click on the Database Settings button
Under the Operational tab
3.1 uncheck Auto create statictics and
3.2 Uncheck Auto update statistics checkbox.
This will reduce your numbers of operations by about 90% and the analysis should finish instantly.
回答2:
This question is a bit old but this comes up first when you search for a solution, so I will add my 2 cents.
If you still have this problem after installing the fix, try this, this worked for me:
Open the database project folder in Windows Explorer. Delete the following files/folders:
- in the rootdirectory, the .dbmdl file
- the content of the "sql" directory
- the obj directory.
Close and re-open Visual Studio. Click Build.
The project built fine for me.
回答3:
According to the release notes of the March 2013 update of SQL Server Data-Tier Application Framework, this bug should be fixed now.
Database Project in Visual Studio hangs on “Analyzing Database Schema…” This release addresses an issue that can occur when loading or building large Database Projects. In some cases, the operation would never finish. This is a functional fix, not a performance enhancement - even with the fix, the time to complete this operation depends on the size and complexity of your project
http://blogs.msdn.com/b/ssdt/archive/2013/03/06/sql-server-data-tier-application-framework-march-2013-available.aspx
http://www.microsoft.com/en-us/download/details.aspx?id=36842
回答4:
Old question, but looks like still not solved.
My dacpac has over 10000 objects and the build got stuck for over 40 mins on the Validating stage.
Tried the options suggested in other comments and answers but no joy.
Apparently, the Validation of the model also does a "case search".
I unchecked the option and build time dropped to under a minute.
Validate Casing on identifies in SQL Server project in VS2017
回答5:
If the SSDT project is not something that you use all the time (like in my case), you can Unload the project, and leaved it unloaded. This way opening the solution in Visual Studio takes no time.
When you need to do something in the SSDT project, at that time you can Reload the project.
回答6:
Here is a possible fix. (I have had to recreate the schema on SQL databases before, due to speed issues) but this article might be worth looking at. - sounds closer to your issue.
Can't open my dbml file in Visual Studio 2010 anymore
回答7:
Analyzing database objects (in VS 2015 Update 3) was taking more time than usual, and was occurring after repeated attempts at restarting VS. I suspect things had hung when the number of objects hadn't changed for 15 minutes. For me, the following got me going again;
- Close VS
- Make a backup copy of the solution file (*.sln)
- Edit the solution file, removing the database projects Restart VS. I
found that I was able to now open the solution and build
- Close the solution and replace your edited solution file with the original
backup
- Restart VS. I found that the solution opened this time, and I was able to build successfully
Hopefully this helps someone in the same spot that I was in.
回答8:
For this case, if you wouldn't include it (sql files) in project build, choose option "Not In Build" when creating file(s) or change sql file property Build = "None". That will make changes against .sqlproj file and visual studio restart required.
That fixed for me and saved my life!