Extended Properties on Foreign Keys missing
a.higgins
Posts: 90 Bronze 2
When I make a deployment using SQL Compare to a parent table with foreign keys pointing at it, the foreign keys are often dropped and recreated.
Unfortunately, any extended properties on those foreign keys are not recreated as part of the deployment process, and I then have to issue a second deployment script to add the extended properties back in.
Can you please ensure that extended properties are recreated on any foreign keys that are dropped and recreated during a deployment?
Unfortunately, any extended properties on those foreign keys are not recreated as part of the deployment process, and I then have to issue a second deployment script to add the extended properties back in.
Can you please ensure that extended properties are recreated on any foreign keys that are dropped and recreated during a deployment?
Comments
Thanks for your post!
Can you confirm the detailed version of SQL Compare you are using? (Help --> About SQL Compare)
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com
This morning I used SQL Compare to do a Production deployment changing a table called DimCourse. The table had to be rebuilt due to a change in column order caused by the addition of a new column.
There are four different foreign keys that point to DimCourse as a referenced object. Before the deployment, all four of the foreign key constraints had two extended properties defined: MS_Description and FK_On_Delete_Action. QA and Prod showed no differences between those four tables.
SQL Prompt generated a script which dropped the foreign keys from the other objects, dropped / rebuilt DimCourse, and then recreated the foreign keys on the other objects. However, the script did not also recreate the extended properties that had previously been defined on those foreign keys.
After the deployment was complete, I reran SQL Compare and it found differences between the two environments, and wants me to use the following script to re-sync them:
I would expect that these extended properties should be recreated as part of the initial deployment, when the foreign keys referencing the changed object are recreated.
Thanks for your post and sorry you have been running into this issue. I can reproduce this problem and see it happening. I am going to add an issue into our internal bug tracking software to fix this, but at the moment I could not say when we are likely to be able to look into it.
In the meantime I believe that re-running your deployment would re-add the extended properties that have been lost in rebuilding foreign keys, so this may be a useful approach to try.
Matthew Chandler
Software Developer on SQL Compare and SQL Data Compare
Software Developer on SQL Compare and SQL Data Compare
Software Developer on SQL Compare and SQL Data Compare