If you see error messages in your “Error List” window it may be because you are in a non compiled sql file. Just close all open windows and do a rebuild to see if any real issues exist on your system.
Make sure that you always rebuild before deploying or your prior build may be deployed. To be really careful, you can check the publish.sql and .dacpac files (located under your bin (Debug or Release)), and then check the timestamps on the files to make sure nothing is going on weird with your visual studio not actually building.
Error Messages on Database Projects can be confusing at best sometimes. These tips are especially useful if you are populating your tables via update scripts. Here are a few different ways to attempt to find the real error:
- Use the unique identifier or other unique identifier in the error message. If there isn’t one it may be hard to find the actual error.
- Wrap Print Messages Around all of your Post-Deploy scripts at the start and end of the script. That way you can see exactly where the publish failed.
- Double check spellings of any Post-Deploy or other related scripts that you try to populate.
- Undo all of your changes back to a known good deploy and then slowly add in the new scripts.
- If your issue only happens on Update, look into using a DB Up or migration script approach (I may do another quick article on this later.