Search code examples
sql-server-data-tools

When using SQL Server Data Tools, what can I do about the error message 'An error has occurred. The target schema is in an unknown state.'?


I'm comparing a database in a local SQL Server 2014 instance against an SSDT database project.

I have done previous comparisons and they have worked fine.

At times I also change the project database target from SQL Server 2014 to SQL Azure to push changes to a SQL Azure database.

I made sure the project was set to SQL Server 2014 before trying to perform the most recent comparison and update.

Unfortunately the error message gives no indication of what went wrong, where it went wrong, or where to find more information.

Further more a quick Google for the error text gives no results! It seems no one has even mentioned this error before on the internet.

(That's not quite true any more. You can now find where I'm asking about this issue on the MSDN forums, currently with no response.)

Does anyone know if this error message relates to something specific? Or is there a way to find out more information from a log? How do I debug, and ideally resolve this?!


Solution

  • For now I have deleted all the sql files, and the cache file (dbmdl) from the project and then performed another compare/update.

    This allows me to continue working, but it's an unsatisfying resolution.