Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update database with visual studio database projects

Hy,

I'am trying to use Visual Studio 2012 database project to upgrade a database to a newer version but i'am having a weird problem.I select the source database then the target database and hit compare.Visual Studio generates the script with the differences and when i execute it fails because it tries to drop tables without first dropping the FK constraints that are on those tables.(normally it should first script all the constrains from a table,drop them,drop the table,after that create the new table and finally recreating the constraints)

Do you have any ideas why it tries to do directly drop table without dropping constraints first. Am i missing some settings?

like image 622
Roman Marius Avatar asked Jan 21 '26 01:01

Roman Marius


1 Answers

Sounds like a bug to me. Try posting the same question on the SSDT forum.

If you have access to a copy of SQL Compare, it might be worth trying the same comparison to see if this works better. If you're using a database project as a data source, you'll need to select "source control", then "scripts folder", and browse to the folder that contains the .sqlproj file. Here at Red Gate we're working on improving database project support in SQL Compare so we'd welcome any feedback or questions.

like image 97
David Atkinson Avatar answered Jan 23 '26 19:01

David Atkinson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!