5
votes

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
3
Have you checked the ownership of the restored databases? - Tom Page
Just to be sure, I made my login the owner. No success. Also this issue prevents publishing brand new databases so it's likely another issue. - ElPresidente
have you tried it from a different pc to determine if it's something in your environment? You could also try uninstalling/reinstalling VS - Beth
Have you tried turning it off and on again? - Marcel N.
Have you updated to the latest version of SSDT? Do try VS 2013 Express, as it does support database projects. - Jonathan Amend

3 Answers

3
votes

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.

1
votes

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.