Update Target Button is disabled in Sql Server Database Schema Comparison
Asked Answered
O

4

10

I use Visual Studio 2013 Professional Update 4 in combination with multiple SQL Server 2012 Enterprise servers/instances. The Idea was to create a Version controlled deployment using a Visual Studio Solution with SQL Server Projects.

However for some reason the "Update Target" and "Generate Script" button is disabled.

Schema Compare

I can update the local database project from the sql server database but the other way around is not working. (see screenshot)

Google is not helpful at all although I found a few people with a similar problem.

Update target button is disabled after schema comparison

VS2012: Schema compare, update button disabled

VS2012 Schema compare buttons disabled

But none of this questions/blogposts is about Visual Studio 2013 and in addition none of the proposed solutions is working for me.

Question: Why is the Update Target button disabled and what do I have to change to fix this?

Note: Of course, I'm using the latest version of SQL Server Data Tools(12.0.50318.0)

Osmose answered 26/3, 2015 at 11:33 Comment(4)
The first link you provided actually solved the problem for me, https://mcmap.net/q/335405/-update-target-button-is-disabled-after-schema-comparison. Check the error list window to see if there are any errors. In my case, I had an invalid column name.Enloe
I have plenty off Errors mostly due to unresolved/ambiguous references. However, I don't think that visual studio schema compare should bother about this.Osmose
Possible duplicate of Update target button is disabled after schema comparisonFawcette
I've created VS UserVoice suggestion Keep "update" and "generate update script" buttons enabled. Please vote if you agree.Fawcette
M
6

This was driving me nuts, as well. I finally noticed a "warning" message stating "Cannot generate deployment plan due to an internal error". Because of this, the Update and Generate Script buttons were both disabled.

I resolved this by closing Visual Studio, navigating to the folder containing the Database project and removing all (*.dbmdl) files. I then restarted Visual Studio, re-ran the compare schema and the Update button was enabled.

Murphree answered 30/9, 2015 at 5:10 Comment(1)
I also had this "warning" and tried this solution, no joy. There were also errors on external data sources/tables, excluding them didn't help, BUT: doing a schema compare without those externals present finally did work. I accomplished this by creating a (temporary) new project, compared & updated that excluding the externals, then did a schema compare from the new project to the DB.Industrials
H
5

The tip that helped me was to look at the error list. (View Menu, Error List). Once I cleared the errors (just the errors, the ones with the red X) I was able to compare the schema again and the Update and Generate Scripts buttons were both enabled.

Hildie answered 30/4, 2016 at 13:22 Comment(0)
I
0

Beside the generate script, click on OPTIONS and select only the objects for which you want to compare. This and ONLY this worked for me.

Illsorted answered 15/7, 2020 at 11:47 Comment(0)
A
0

For me it was because there was a circular reference between 2 views (2 views that referenced each other). I didn't find out until I finally gave up and tried to manually create the views in the database.

Any answered 7/3 at 15:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.