Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio unable to publish or schema compare database

I have no idea what went wrong with my Visual Studio, but I am unable to publish or schema compare any database on my development server. Here are my two issues:

  • When publishing a new database I get an error message after timing out that says "Unable to reconnect to database"

  • When schema comparing to an existing database I get an error message saying "An error was received from SQL Server while attempting to reverse engineer elements of type..."

Additional Troubleshooting

  • I am connecting to the server as myself with Windows Authentication. I am already set up on the development server as a sysadmin role.
  • I have no issues logging in via Management Studio
  • I can create a database using the login in Management Studio
  • The "test connection" button in VS2012 says connection successful
  • I have deleted the database in question from the database and attempted to republish with no success
  • I have started a completely new VS SQL project and tried to publish a new test database, but have the same exact issue
  • I have no problems whatsoever on my production server
  • I have deleted my server login and recreated it
  • I can't schema compare or publish a database even with the [sa] account
  • I have restarted both SQL Server instance and Windows Server itself

The only recent change to the server was that I restored two production database backups into my development server. I do not know if this is when the issue started.

What else can/should I be trying??

Update This question is still preventing me from schema comparing or publishing any database. Even from a new project. Additional troubleshooting since the first post:

  • Deleted SQL Server from the server and reinstalled
  • Removed all connection references to development server from client registry
  • SQL Server Profiler shows Visual Studio is successfully executing commands, however the above messages persist
like image 866
ElPresidente Avatar asked Sep 30 '22 05:09

ElPresidente


2 Answers

Please try updating to the latest version of SSDT (the tools for working with databases in Visual Studio). Also, since you are using VS 2012, consider trying VS 2013 Express, at least to see if it fixes your issues, as it includes the tools for working with database projects.

like image 178
Jonathan Amend Avatar answered Oct 04 '22 19:10

Jonathan Amend


Verify that you can build your DB project before starting the Schema Compare.

Although building is part of the Compare process, sometimes build errors aren't clearly shown when using Schema Compare.

like image 43
Adriang Avatar answered Oct 04 '22 19:10

Adriang