Deploying modified UDF that is referenced by a constraint
MckMurray
Posts: 37 Bronze 4
We have a lot of table check constraints where the validation logic is encapsulated in a scalar UDF. In order to successfully deploy changes to such objects, it is necessary to first drop the referencing constraint, make changes to the function, and then re-create the constraint, otherwise you get an error like "Cannot ALTER 'dbo.ScalarFunction' because it is being referenced by object 'TableName'."
It would appear SQL Compare attempts to simply modify the UDF, which means I have to manually go in and fix the deployment script for any deployment that touches one of these UDFs.
This would appear to be a bug - has anyone else run into this?
It would appear SQL Compare attempts to simply modify the UDF, which means I have to manually go in and fix the deployment script for any deployment that touches one of these UDFs.
This would appear to be a bug - has anyone else run into this?
Comments
Thanks for your post.
We have created a support ticket to follow up on this.
Product Support Engineer
Redgate Software Ltd
Please see our Help Center for detailed guides on how to use our tools