Generate Script button is disabled in visual studio after schema comparison

cSteusloff picture cSteusloff · Oct 23, 2017 · Viewed 7.1k times · Source

I would like to create a delta script from the database and my database project. The database as source and database project as target. The Update button works fine without any errors and my Error List contains only this warning:

The login for the source does not have the VIEW ANY DEFINITION permission. The comparison will be restricted to database scoped elements if the target is a database.

This permission: https://technet.microsoft.com/en-us/library/ms175808(v=sql.105).aspx

enter image description here

The post Update target button is disabled after schema comparison did not help me.

How can I active the generate Script Button in Visual Studio Enterprise 2017? Do I really need access to the metadata for script generation?

(edit):

Even with this permission it does not work. But I can generate a script when comparing two databases.

Answer

Shamal Perera picture Shamal Perera · Jan 15, 2018

Generate Script button is disabled if your target is a Database project. To generate a script, you could compare with your target database directly instead of database project.