HiveBrain v1.2.0
Get Started
← Back to all entries
principleMinor

visual studio database project - publish did not include drops but schema compare did

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
publishvisualdidincludebutdatabaseschemaprojectstudiocompare

Problem

I just observed a difference in the result of publish vs schema compare. I made changes to visual studio database project - some of which involved deleting tables.

  • Pushed changes to VSTS, build successful, release successful to Azure DB



  • Inspected said Azure DB. Tables were not dropped that were deleted in the project. Double checked the publish script - this didn't include any of the drops.



  • Ran SchemaCompare - this exposed all of the missing drops, and when executed gave me the result I expected (the applicable tables were dropped).



The same results were observed on local DB when manually publishing vs schema compare. What am I doing incorrectly? I thought publish would drop the tables.

Solution

Publish>Advanced Settings>Drop>"Drop objects in target but not in source"

https://stackoverflow.com/questions/1799802/dropping-a-table-with-visual-studio-2010-database-project

Context

StackExchange Database Administrators Q#166985, answer score: 6

Revisions (0)

No revisions yet.