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)

Community
  • 1
  • 1
Joel
  • 4,862
  • 7
  • 46
  • 71
  • The first link you provided actually solved the problem for me, http://stackoverflow.com/a/25204994/864274. Check the error list window to see if there are any errors. In my case, I had an invalid column name. – StuckOverflow Apr 20 '15 at 15:07
  • 4
    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. – Joel Apr 21 '15 at 08:51
  • Possible duplicate of [Update target button is disabled after schema comparison](http://stackoverflow.com/questions/17742638/update-target-button-is-disabled-after-schema-comparison) – Michael Freidgeim Nov 28 '16 at 03:19
  • 1
    I've created VS UserVoice suggestion [Keep "update" and "generate update script" buttons enabled](https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/17396128-keep-update-and-generate-update-script-buttons). Please vote if you agree. – Michael Freidgeim Dec 11 '16 at 07:27

3 Answers3

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.

johnl
  • 234
  • 3
  • 6
  • 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. – 8forty Jan 23 '20 at 20:00
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.

user2721607
  • 318
  • 4
  • 7
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.